Skip to content

Commit

Permalink
Copy flood and wait_for_traffic flag from replacement route
Browse files Browse the repository at this point in the history
When a subnet route is deleted, replacement route was getting
sent with flood flag set, and the replacement route would
not have flood flag set hence vrouter would not collapse the
bucket. Eventually if a covering route is changes thses subnet
route would not be updated
Closes-bug:#1459385

Change-Id: I74a73013cdc91ecaf270a72e315c0a8758603c17
  • Loading branch information
naveen-n committed May 28, 2015
1 parent e82b366 commit 5b75e0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/vnsw/agent/ksync/route_ksync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ int RouteKSyncEntry::DeleteMsg(char *buf, int buf_len) {

// IF multicast or EVPN delete unconditionally
if (rt_type_ == RT_MCAST || rt_type_ == RT_LAYER2) {
return DeleteInternal(nh(), 0, 0, false, buf, buf_len);
return DeleteInternal(nh(), 0, 0, false, false, false,
buf, buf_len);
}

// For INET routes, we need to give replacement NH and prefixlen
Expand All @@ -391,7 +392,9 @@ int RouteKSyncEntry::DeleteMsg(char *buf, int buf_len) {
if(ksync_nh && ksync_nh->IsResolved()) {
return DeleteInternal(ksync_nh, route->label(),
route->prefix_len(),
route->proxy_arp(), buf, buf_len);
route->proxy_arp(), route->flood(),
route->wait_for_traffic(),
buf, buf_len);
}
ksync_nh = NULL;
}
Expand All @@ -410,16 +413,20 @@ int RouteKSyncEntry::DeleteMsg(char *buf, int buf_len) {
ksync_nh = static_cast<NHKSyncEntry *>(ksync_nh_object->Find(&nh_key));
}

return DeleteInternal(ksync_nh, 0, 0, false, buf, buf_len);
return DeleteInternal(ksync_nh, 0, 0, false, false, false, buf, buf_len);

}


int RouteKSyncEntry::DeleteInternal(NHKSyncEntry *nexthop, uint32_t lbl,
uint8_t replace_plen, bool proxy_arp,
bool flood_arp, bool wait_for_traffic,
char *buf, int buf_len) {
nh_ = nexthop;
label_ = lbl;
proxy_arp_ = proxy_arp;
flood_ = flood_arp;
wait_for_traffic_ = wait_for_traffic;

KSyncRouteInfo info;
FillObjectLog(sandesh_op::DELETE, info);
Expand Down
6 changes: 5 additions & 1 deletion src/vnsw/agent/ksync/route_ksync.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class RouteKSyncEntry : public KSyncNetlinkDBEntry {
uint32_t prefix_len() const { return prefix_len_; }
uint32_t label() const { return label_; }
bool proxy_arp() const { return proxy_arp_; }
bool flood() const { return flood_;}
bool wait_for_traffic() const { return wait_for_traffic_;}

NHKSyncEntry* nh() const {
return static_cast<NHKSyncEntry *>(nh_.get());
}
Expand All @@ -53,7 +56,8 @@ class RouteKSyncEntry : public KSyncNetlinkDBEntry {
int Encode(sandesh_op::type op, uint8_t replace_plen,
char *buf, int buf_len);
int DeleteInternal(NHKSyncEntry *nh, uint32_t lbl, uint8_t replace_plen,
bool proxy_arp, char *buf, int buf_len);
bool proxy_arp, bool flood_arp, bool wait_for_traffic,
char *buf, int buf_len);
bool UcIsLess(const KSyncEntry &rhs) const;
bool McIsLess(const KSyncEntry &rhs) const;
bool L2IsLess(const KSyncEntry &rhs) const;
Expand Down

0 comments on commit 5b75e0b

Please sign in to comment.