Skip to content

Commit

Permalink
Merge "Fix for interface link-state going out-of-sync between agent a…
Browse files Browse the repository at this point in the history
…nd host-os" into R2.20
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 20, 2015
2 parents b4b9565 + 3503adf commit 73fe6e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/vnsw/agent/vrouter/ksync/linux/vnswif_listener.cc
Expand Up @@ -297,7 +297,7 @@ VnswInterfaceListenerLinux::HandleNetlinkIntfMsg(struct nlmsghdr *nlh) {
assert(port_name != NULL);
LOG(DEBUG, "Handle netlink interface message "
<< NetlinkTypeToString(nlh->nlmsg_type)
<< " for interface " << port_name);
<< " for interface " << port_name << " flags " << ifi->ifi_flags);

Event::Type type;
if (nlh->nlmsg_type == RTM_DELLINK) {
Expand Down
17 changes: 2 additions & 15 deletions src/vnsw/agent/vrouter/ksync/vnswif_listener_base.cc
Expand Up @@ -191,26 +191,20 @@ void VnswInterfaceListenerBase::SetSeen(const std::string &name, bool oper) {
host_interface_table_.insert(make_pair(name, entry));
}

bool old_active = IsInterfaceActive(entry);
if (oper) {
entry->oper_seen_ = true;
} else {
entry->host_seen_ = true;
}

if (old_active == IsInterfaceActive(entry))
return;

if (old_active == false)
Activate(name, entry->oper_id_);
Activate(name, entry->oper_id_);
}

void VnswInterfaceListenerBase::ResetSeen(const std::string &name, bool oper) {
HostInterfaceEntry *entry = GetHostInterfaceEntry(name);
if (entry == NULL)
return;

bool old_active = IsInterfaceActive(entry);
if (oper) {
entry->oper_seen_ = false;
} else {
Expand All @@ -224,11 +218,7 @@ void VnswInterfaceListenerBase::ResetSeen(const std::string &name, bool oper) {
return;
}

if (old_active == IsInterfaceActive(entry))
return;

if (old_active)
DeActivate(name, entry->oper_id_);
DeActivate(name, entry->oper_id_);
}

void VnswInterfaceListenerBase::SetLinkState(const std::string &name, bool link_up){
Expand All @@ -239,9 +229,6 @@ void VnswInterfaceListenerBase::SetLinkState(const std::string &name, bool link_
bool old_active = IsInterfaceActive(entry);
entry->link_up_ = link_up;

if (old_active == IsInterfaceActive(entry))
return;

if (old_active)
DeActivate(name, entry->oper_id_);
else
Expand Down

0 comments on commit 73fe6e2

Please sign in to comment.