Skip to content

Commit

Permalink
Retain the VRF and policy flag on the interface when HC fails.
Browse files Browse the repository at this point in the history
In case of L3-only network, the VRF and policy flag are being reset when
HC deactivates an interface. Change this to retain these values correctly.

Change-Id: Ib5d8b7c40cbd4c109abad3e34e51ca176e196d94
closes-bug: #1642672
  • Loading branch information
haripk committed Nov 21, 2016
1 parent e45ed0f commit c26dd64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vnsw/agent/vrouter/ksync/interface_ksync.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ InterfaceKSyncEntry::InterfaceKSyncEntry(InterfaceKSyncObject *obj,
layer3_forwarding_(entry->layer3_forwarding_),
ksync_obj_(obj), l2_active_(false),
metadata_l2_active_(entry->metadata_l2_active_),
metadata_ip_active_(entry->metadata_ip_active_),
bridging_(entry->bridging_),
mac_(entry->mac_),
smac_(entry->smac_),
Expand Down Expand Up @@ -95,6 +96,7 @@ InterfaceKSyncEntry::InterfaceKSyncEntry(InterfaceKSyncObject *obj,
ksync_obj_(obj),
l2_active_(false),
metadata_l2_active_(false),
metadata_ip_active_(false),
bridging_(true),
mac_(),
smac_(),
Expand Down Expand Up @@ -277,14 +279,21 @@ bool InterfaceKSyncEntry::Sync(DBEntry *e) {
vm_port->metadata_l2_active();
ret = true;
}

if (metadata_ip_active_ !=
vm_port->metadata_ip_active()) {
metadata_ip_active_ =
vm_port->metadata_ip_active();
ret = true;
}
}

uint32_t vrf_id = VIF_VRF_INVALID;
bool policy_enabled = false;
std::string analyzer_name;
Interface::MirrorDirection mirror_direction = Interface::UNKNOWN;
bool has_service_vlan = false;
if (l2_active_ || ipv4_active_ || metadata_l2_active_) {
if (l2_active_ || ipv4_active_ || metadata_l2_active_ || metadata_ip_active_) {
vrf_id = intf->vrf_id();
if (vrf_id == VrfEntry::kInvalidIndex) {
vrf_id = VIF_VRF_INVALID;
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/vrouter/ksync/interface_ksync.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class InterfaceKSyncEntry : public KSyncNetlinkDBEntry {
InterfaceKSyncObject *ksync_obj_;
bool l2_active_;
bool metadata_l2_active_;
bool metadata_ip_active_;
bool bridging_;
MacAddress mac_;
MacAddress smac_;
Expand Down

0 comments on commit c26dd64

Please sign in to comment.