Skip to content

Commit

Permalink
Handle error from XMPP session send.
Browse files Browse the repository at this point in the history
Problem:
If XMPP channel send fails which internally(TCP send) translates into a defer
send operation, then agent controller module was treating this as a failure.
In case of route update which is seen in bug any such defer will result in
exported flag for route set to false. Since it is set to false, later on route
delete the unsubscribe for this route will not be sent. However update of route
was deferred and would have gone in some time but control node will never get
delete which will result in issue mentioned by the bug.

Solution:
Ideally all the failed send should be used to enqueue further requests to
control node and replay them whenever callback(writereadycb) is called.
In this way agent will not overload socket.
However as a quick fix the error will not be used to judge the further operation
after send is done. This is in asumption that send will always be succesful.
Currently following messages are sent:
1) VM config sub/unsub
2) Config subscribe for agent
3) VRF sub/unsub
4) Route sub/unsub.
Connection not present will be taken care by channel flap handling.

Change-Id: Ib6e0856b5c689b51209add4ab459b8bd2e952143
Closes-bug: 1453483
(cherry picked from commit 0a70915)

VRF state not deleted in DelPeer walk.

Problem statement remains same as in this commit:
8e302fc

However above commit does not solve the issue.
Reason being, walk count was being incremented on enqueue of walk but when walk
is processed it calls Cancel for any previously started walk. This Cancel
decrements the walk count. This defeats the purpose of moving walk count
increment to enqueue in above commit.
Also consider a walk for VRF where there are four route tables. This should
result in walk count to be 5 (1 for vrf table + 4 for route tables). With above
fix this will be 2 (1 for Vrf + 1 for route table). It didnt take into
consideration that route walk count needs to be incremented for each route
table.

Solution:
Use a seperate enqueue walk count and restore the walk_count as it was before
the above commit. Use both of them to check for walk done.

Closes-bug: 1455862
Change-Id: I8d96732375f649e70d6754cb6c5b34c24867ce0c
(cherry picked from commit 7051658)

Multicast route gets deleted when vxlan id is changed in configured mode

Problem:
In oper multicast if local peer vxlan-id is changed then there was add issued
for route with new vxlan and delete issued for same with old vxlan.
Since the peer is local the path search only compares peer and not vxlan.
This results in deletion of local path and eventually the multicast route.

Solution:
Need not withdraw path from local peer on vxlan id change. Just trigger update
of same. This will result in controller route _export call which in turn using
state set on flood route, will be able to identify that vxlan id is changed and
it will take care of withdrawal for old vxlan and update with new vxlan.

Change-Id: I3afeddd2620615bb477aec5a0c6715fcdc99352b
Closes-bug: 1457007
(cherry picked from commit a77f2c3)

Mac route in agent was having invalid label and destination NH.

Problem:
Two issues were seen -
1) Label was wrongly interpreted as MPLS though it was VXLAN and never got
corrected. Sequence of events was that EVPN route was received before global
vrouter config. Encapsulation priorities was absent in agent, so evpn route
was programmed with Mpls-gre(control-node had sent Vxlan). Since Mpls encap
was chosen, label was interpreted as mpls label and not vxlan. When global
vrouter config was received resync was done for route. Resync also failed to
rectify encap to Vxlan(since vxlan is now available in priorities) because this
decision to rectify is based on vxlan id(i.e. if vxlan id is 0 default to mpls
                                         as its invalid). In this case vxlan id
was 0 as explained above and hence encap continued to be Mpls.

2) Nexthop was different between evpn route and derived mac route.
This happened because in path sync of evpn route return was false even though NH
change was seen which resulted in avoidance of mac route rebake. Return was
false because value set by ChangeNh as true was overridden by MplsChange.

Solution:
For case 1) - If encap is Vxlan only in the message sent by control-node then
put label as vxlan id and mpls label as invalid, even though tunnel type is
computed as Mpls(encapsulation prioirties is not received). In case of Mpls
encap sent use label as Mpls and reset vxlan to invalid. In case both Vxlan and
Mpls are sent in encap then fallback to old approach of interpreting label on
computed tunnel type.

For case 2) - Fix the return value.

Change-Id: Ibeeb3de16d618ecb931c35d8937591d9c9f7f15e
Closes-bug: 1457355
(cherry picked from commit f8f09e3)

Multicast route not deleted on vrf delete.

In Tor agent multicast route does not get deleted when VRF is deleted. This is
becasue deletion is triggered from logical-switch delete. Though that is valid,
vrf delete should also result in route delete.
As mentioned in the bug there can be cases in scaled setup where vrf delete is
received and VN delete is delayed. This may result in multicast route dangling
till VN is received. Ultimately if Vrf delete timeout gets executed then it will
crash.

Change-Id: I8db095a6e99dddeb17bea2edbcbe10fab4c58623
Closes-bug: 1458187
(cherry picked from commit e6c1005)

AgentXmppChannel is invalid in route notification.

Problem:
Every AgentXmppChannel has a peer created on channel coming up. When channel
goes down this peer is deleted and a walk is started to delete states and path
for this peer in route and vrf entries. After channel has gone into not-ready
state, it may get timedout and ultimately deleted. However walk is still
underway and the deleted peer of this channel is not yet unregistered from vrf
and route tables. Either this walk notification or any update on db-entry in
these tables will send deleted channel in argument. This will result in crash.

Solution:
On every notification there is a check to find out if its for active peer or
deleted one(IsBgpPeerActive). In the same routine check if channel passed is one
of the channels being used by agent or not. If its not then conside peer as
inactive.

Change-Id: I8cdb01d9e5a6c83e6f9f7b6785288d9ea5c973d2
Closes-bug: 1458529
(cherry picked from commit 9056ce9)

On deletion of AgentXmppchannel, BGP peer was not cleared properly.

Ideally every channel state change is responsible for cleaning up or creating
BGP peer. However with commit
6d845c1
above assumption will not be true.
To fix it artificially inject a channel down event on deletion of agent xmpp
channel. Since BGP peer is being manipulated also push the process of applying
discovery servers to controller work queue.

Change-Id: Ia733ed1061747153fbfb841f63813ad148ce6bfc
Closes-bug: 1460435
(cherry picked from commit 45df647)
  • Loading branch information
manishsing committed Jun 11, 2015
1 parent f696899 commit bf9e767
Show file tree
Hide file tree
Showing 26 changed files with 449 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/vnsw/agent/cmn/agent.h
Expand Up @@ -460,7 +460,7 @@ class Agent {
xs_stime_[idx] = time;
}

AgentXmppChannel *controller_xmpp_channel(uint8_t idx) {
AgentXmppChannel *controller_xmpp_channel(uint8_t idx) const {
return agent_xmpp_channel_[idx];
}

Expand Down
9 changes: 5 additions & 4 deletions src/vnsw/agent/controller/controller_export.cc
Expand Up @@ -75,7 +75,8 @@ void RouteExport::ManagedDelete() {
}

// Route entry add/change/del notification handler
void RouteExport::Notify(AgentXmppChannel *bgp_xmpp_peer,
void RouteExport::Notify(const Agent *agent,
AgentXmppChannel *bgp_xmpp_peer,
bool associate, Agent::RouteTableType type,
DBTablePartBase *partition, DBEntryBase *e) {
AgentRoute *route = static_cast<AgentRoute *>(e);
Expand All @@ -84,7 +85,7 @@ void RouteExport::Notify(AgentXmppChannel *bgp_xmpp_peer,
if (!route->IsDeleted()) {
// If there is no active BGP peer attached to channel, ignore
// non-delete notification for this channel
if (!AgentXmppChannel::IsBgpPeerActive(bgp_xmpp_peer))
if (!AgentXmppChannel::IsBgpPeerActive(agent, bgp_xmpp_peer))
return;

// Extract the listener ID of active BGP peer for route table to which
Expand Down Expand Up @@ -398,8 +399,8 @@ RouteExport* RouteExport::Init(AgentRouteTable *table,
RouteExport *rt_export = new RouteExport(table);
bool associate = true;
rt_export->id_ = table->Register(boost::bind(&RouteExport::Notify,
rt_export, bgp_xmpp_peer, associate,
table->GetTableType(), _1, _2));
rt_export, table->agent(), bgp_xmpp_peer,
associate, table->GetTableType(), _1, _2));
return rt_export;
}

4 changes: 2 additions & 2 deletions src/vnsw/agent/controller/controller_export.h
Expand Up @@ -34,8 +34,8 @@ class RouteExport {
RouteExport(AgentRouteTable *rt);
~RouteExport();

void Notify(AgentXmppChannel *bgp_xmpp_peer, bool associate,
Agent::RouteTableType type,
void Notify(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer,
bool associate, Agent::RouteTableType type,
DBTablePartBase *partition, DBEntryBase *e);
void ManagedDelete();
DBTableBase::ListenerId GetListenerId() const {return id_;};
Expand Down
6 changes: 3 additions & 3 deletions src/vnsw/agent/controller/controller_ifmap.cc
Expand Up @@ -132,7 +132,7 @@ void AgentIfMapVmExport::Notify(DBTablePartBase *partition, DBEntryBase *e) {
peer = agent_->controller_xmpp_channel(agent_->ifmap_active_xmpp_server_index());
ifmap = agent_->ifmap_xmpp_channel(agent_->
ifmap_active_xmpp_server_index());
if (AgentXmppChannel::IsBgpPeerActive(peer) && ifmap) {
if (AgentXmppChannel::IsBgpPeerActive(agent_, peer) && ifmap) {
if ((info->seq_number_ == ifmap->GetSeqNumber()) &&
(info->vmi_list_.size() == 1)) {
CONTROLLER_TRACE(IFMapVmExportTrace, vmid.str(), "",
Expand Down Expand Up @@ -178,7 +178,7 @@ void AgentIfMapVmExport::Notify(DBTablePartBase *partition, DBEntryBase *e) {

//Ensure that peer exists and is in active state
peer = agent_->controller_xmpp_channel(agent_->ifmap_active_xmpp_server_index());
if (!AgentXmppChannel::IsBgpPeerActive(peer)) {
if (!AgentXmppChannel::IsBgpPeerActive(agent_, peer)) {
return;
}

Expand Down Expand Up @@ -209,7 +209,7 @@ void AgentIfMapVmExport::NotifyAll(AgentXmppChannel *peer) {
struct VmExportInfo *info = NULL;
Agent *agent = peer->agent();

if (!AgentXmppChannel::IsBgpPeerActive(peer)) {
if (!AgentXmppChannel::IsBgpPeerActive(agent, peer)) {
return;
}

Expand Down
38 changes: 36 additions & 2 deletions src/vnsw/agent/controller/controller_init.cc
Expand Up @@ -30,6 +30,10 @@ using namespace boost::asio;
SandeshTraceBufferPtr ControllerTraceBuf(SandeshTraceBufferCreate(
"Controller", 1000));

ControllerDiscoveryData::ControllerDiscoveryData(std::vector<DSResponse> resp) :
ControllerWorkQueueData(), discovery_response_(resp) {
}

VNController::VNController(Agent *agent)
: agent_(agent), multicast_sequence_number_(0),
unicast_cleanup_timer_(agent), multicast_cleanup_timer_(agent),
Expand Down Expand Up @@ -230,6 +234,22 @@ void VNController::DnsXmppServerDisConnect() {

}

//During delete of xmpp channel, check if BGP peer is deleted.
//If not agent never got a channel down state and is being removed
//as it is not part of discovery list.
//Artificially inject NOT_READY in agent xmpp channel.
void VNController::DeleteAgentXmppChannel(AgentXmppChannel *channel) {
if (!channel)
return;

BgpPeer *bgp_peer = channel->bgp_peer_id();
if (bgp_peer != NULL) {
AgentXmppChannel::HandleAgentXmppClientChannelEvent(channel,
xmps::NOT_READY);
}
delete channel;
}

//Trigger shutdown and cleanup of routes for the client
void VNController::DisConnect() {
XmppServerDisConnect();
Expand Down Expand Up @@ -303,11 +323,11 @@ void VNController::DisConnectControllerIfmapServer(uint8_t idx) {

//cleanup AgentXmppChannel
agent_->ResetAgentMcastLabelRange(idx);
delete agent_->controller_xmpp_channel(idx);
DeleteAgentXmppChannel(agent_->controller_xmpp_channel(idx));
agent_->set_controller_xmpp_channel(NULL, idx);

//cleanup AgentIfmapXmppChannel
delete agent_->ifmap_xmpp_channel(idx);
delete agent_->ifmap_xmpp_channel(idx);
agent_->set_ifmap_xmpp_channel(NULL, idx);

agent_->controller_ifmap_xmpp_init(idx)->Reset();
Expand All @@ -331,7 +351,13 @@ bool VNController::AgentXmppServerExists(const std::string &server_ip,
}

void VNController::ApplyDiscoveryXmppServices(std::vector<DSResponse> resp) {
ControllerDiscoveryDataType data(new ControllerDiscoveryData(resp));
ControllerWorkQueueDataType base_data =
boost::static_pointer_cast<ControllerWorkQueueData>(data);
work_queue_.Enqueue(base_data);
}

bool VNController::ApplyDiscoveryXmppServicesInternal(std::vector<DSResponse> resp) {
std::vector<DSResponse>::iterator iter;
int8_t count = -1;
for (iter = resp.begin(); iter != resp.end(); iter++) {
Expand Down Expand Up @@ -415,6 +441,7 @@ void VNController::ApplyDiscoveryXmppServices(std::vector<DSResponse> resp) {
}

XmppServerConnect();
return true;
}

AgentDnsXmppChannel *VNController::FindAgentDnsXmppChannel(
Expand Down Expand Up @@ -697,6 +724,13 @@ bool VNController::ControllerWorkQueueProcess(ControllerWorkQueueDataType data)
return ControllerPeerHeadlessAgentDelDone(derived_walk_done_data->
bgp_peer());
}
//Discovery response for servers
ControllerDiscoveryDataType discovery_data =
boost::dynamic_pointer_cast<ControllerDiscoveryData>(data);
if (discovery_data) {
return ApplyDiscoveryXmppServicesInternal(discovery_data->
discovery_response_);
}
return true;
}

Expand Down
16 changes: 14 additions & 2 deletions src/vnsw/agent/controller/controller_init.h
Expand Up @@ -66,11 +66,21 @@ class ControllerXmppData : public ControllerWorkQueueData {
DISALLOW_COPY_AND_ASSIGN(ControllerXmppData);
};

class ControllerDiscoveryData : public ControllerWorkQueueData {
public:
ControllerDiscoveryData(std::vector<DSResponse> resp);
virtual ~ControllerDiscoveryData() {}

std::vector<DSResponse> discovery_response_;
DISALLOW_COPY_AND_ASSIGN(ControllerDiscoveryData);
};

class VNController {
public:
typedef boost::shared_ptr<ControllerXmppData> ControllerXmppDataType;
typedef boost::shared_ptr<ControllerDeletePeerData> ControllerDeletePeerDataType;
typedef boost::shared_ptr<ControllerWorkQueueData> ControllerWorkQueueDataType;
typedef boost::shared_ptr<ControllerDiscoveryData> ControllerDiscoveryDataType;
typedef boost::shared_ptr<BgpPeer> BgpPeerPtr;
typedef std::list<boost::shared_ptr<BgpPeer> >::iterator BgpPeerIterator;
VNController(Agent *agent);
Expand All @@ -86,8 +96,8 @@ class VNController {
void XmppServerDisConnect();
void DnsXmppServerDisConnect();

void ApplyDiscoveryXmppServices(std::vector<DSResponse> resp);
void ApplyDiscoveryDnsXmppServices(std::vector<DSResponse> resp);
void ApplyDiscoveryXmppServices(std::vector<DSResponse> resp);
void ApplyDiscoveryDnsXmppServices(std::vector<DSResponse> resp);

void DisConnectControllerIfmapServer(uint8_t idx);
void DisConnectDnsServer(uint8_t idx);
Expand Down Expand Up @@ -129,6 +139,7 @@ class VNController {
bool XmppMessageProcess(ControllerXmppDataType data);
Agent *agent() {return agent_;}
void Enqueue(ControllerWorkQueueDataType data);
void DeleteAgentXmppChannel(AgentXmppChannel *ch);

private:
AgentXmppChannel *FindAgentXmppChannel(const std::string &server_ip);
Expand All @@ -137,6 +148,7 @@ class VNController {
const std::string MakeConnectionPrefix(bool is_dns) const;
bool AgentXmppServerExists(const std::string &server_ip,
std::vector<DSResponse> resp);
bool ApplyDiscoveryXmppServicesInternal(std::vector<DSResponse> resp);

Agent *agent_;
uint64_t multicast_sequence_number_;
Expand Down
53 changes: 43 additions & 10 deletions src/vnsw/agent/controller/controller_peer.cc
Expand Up @@ -81,6 +81,8 @@ AgentXmppChannel::AgentXmppChannel(Agent *agent,
}

AgentXmppChannel::~AgentXmppChannel() {
BgpPeer *bgp_peer = bgp_peer_id_.get();
assert(bgp_peer == NULL);
channel_->UnRegisterReceive(xmps::BGP);
}

Expand All @@ -105,7 +107,7 @@ void AgentXmppChannel::CreateBgpPeer() {
assert(bgp_peer_id_.get() == NULL);
DBTableBase::ListenerId id =
agent_->vrf_table()->Register(boost::bind(&VrfExport::Notify,
this, _1, _2));
agent_, this, _1, _2));
boost::system::error_code ec;
const string &addr = agent_->controller_ifmap_xmpp_server(xs_idx_);
Ip4Address ip = Ip4Address::from_string(addr.c_str(), ec);
Expand Down Expand Up @@ -1238,7 +1240,24 @@ void AgentXmppChannel::MulticastPeerDown(AgentXmppChannel *old_mcast_builder,
* 2) xmpp channel is in READY state
* 3) Valid XMPP channel
*/
bool AgentXmppChannel::IsBgpPeerActive(AgentXmppChannel *peer) {
bool AgentXmppChannel::IsBgpPeerActive(const Agent *agent,
AgentXmppChannel *peer) {
bool xmpp_channel_not_found = true;
//Verify if channel registered is stiil active or has been deleted
//after bgp peer was down. This is checked under existing agent
//xmpp channels in agent.
for (uint8_t idx = 0; idx < MAX_XMPP_SERVERS; idx++) {
if (agent->controller_xmpp_channel(idx) == peer) {
xmpp_channel_not_found = false;
break;
}
}
if (xmpp_channel_not_found)
return false;

//Reach here if channel is present. Now check for BGP peer
//as channel may have come up and created another BGP peer.
//Also check for the state of channel.
if (peer && peer->GetXmppChannel() && peer->bgp_peer_id() &&
(peer->GetXmppChannel()->GetPeerState() == xmps::READY)) {
return true;
Expand Down Expand Up @@ -1456,7 +1475,7 @@ void AgentXmppChannel::HandleAgentXmppClientChannelEvent(AgentXmppChannel *peer,
agent->reset_ifmap_active_xmpp_server();
AgentXmppChannel *new_cfg_peer = agent->controller_xmpp_channel(idx);

if (IsBgpPeerActive(new_cfg_peer) &&
if (IsBgpPeerActive(agent, new_cfg_peer) &&
AgentXmppChannel::SetConfigPeer(new_cfg_peer)) {
AgentXmppChannel::CleanConfigStale(new_cfg_peer);
CONTROLLER_TRACE(Session, new_cfg_peer->GetXmppServer(),
Expand Down Expand Up @@ -1493,7 +1512,7 @@ void AgentXmppChannel::HandleAgentXmppClientChannelEvent(AgentXmppChannel *peer,
// 2) Channel is in READY state
// 3) BGP peer is commissioned for channel
bool evaluate_new_mcast_builder =
IsBgpPeerActive(new_mcast_builder);
IsBgpPeerActive(agent, new_mcast_builder);

if (!evaluate_new_mcast_builder) {
new_mcast_builder = NULL;
Expand Down Expand Up @@ -1567,7 +1586,10 @@ bool AgentXmppChannel::ControllerSendVmCfgSubscribe(AgentXmppChannel *peer,
CONTROLLER_TRACE(Trace, peer->GetBgpPeerName(), "",
std::string(reinterpret_cast<const char *>(data_), datalen_));
// send data
return (peer->SendUpdate(data_,datalen_));
if (peer->SendUpdate(data_,datalen_) == false) {
CONTROLLER_TRACE(Session, peer->GetXmppServer(),
"VM subscribe Send Update deferred", vm, "");
}

return true;
}
Expand Down Expand Up @@ -1604,7 +1626,11 @@ bool AgentXmppChannel::ControllerSendCfgSubscribe(AgentXmppChannel *peer) {
CONTROLLER_TRACE(Trace, peer->GetBgpPeerName(), "",
std::string(reinterpret_cast<const char *>(data_), datalen_));
// send data
return (peer->SendUpdate(data_,datalen_));
if (peer->SendUpdate(data_,datalen_) == false) {
CONTROLLER_TRACE(Session, peer->GetXmppServer(),
"Config subscribe Send Update deferred", node, "");
}
return true;
}

bool AgentXmppChannel::ControllerSendSubscribe(AgentXmppChannel *peer,
Expand Down Expand Up @@ -1650,7 +1676,11 @@ bool AgentXmppChannel::ControllerSendSubscribe(AgentXmppChannel *peer,
datalen_ = XmppProto::EncodeMessage(impl.get(), data_, sizeof(data_));

// send data
return (peer->SendUpdate(data_,datalen_));
if (peer->SendUpdate(data_,datalen_) == false) {
CONTROLLER_TRACE(Session, peer->GetXmppServer(),
"Vrf subscribe Send Update deferred", vrf_id.str(), "");
}
return true;
}

bool AgentXmppChannel::ControllerSendV4V6UnicastRouteCommon(AgentRoute *route,
Expand Down Expand Up @@ -1762,7 +1792,8 @@ bool AgentXmppChannel::ControllerSendV4V6UnicastRouteCommon(AgentRoute *route,

datalen_ = XmppProto::EncodeMessage(impl.get(), data_, sizeof(data_));
// send data
return (SendUpdate(data_,datalen_));
SendUpdate(data_,datalen_);
return true;
}

bool AgentXmppChannel::BuildTorMulticastMessage(EnetItemType &item,
Expand Down Expand Up @@ -2070,7 +2101,8 @@ bool AgentXmppChannel::BuildAndSendEvpnDom(EnetItemType &item,

datalen_ = XmppProto::EncodeMessage(impl.get(), data_, sizeof(data_));
// send data
return (SendUpdate(data_,datalen_));
SendUpdate(data_,datalen_);
return true;
}

bool AgentXmppChannel::ControllerSendEvpnRouteCommon(AgentRoute *route,
Expand Down Expand Up @@ -2218,7 +2250,8 @@ bool AgentXmppChannel::ControllerSendMcastRouteCommon(AgentRoute *route,

datalen_ = XmppProto::EncodeMessage(impl.get(), data_, sizeof(data_));
// send data
return (SendUpdate(data_,datalen_));
SendUpdate(data_,datalen_);
return true;
}

bool AgentXmppChannel::ControllerSendEvpnRouteAdd(AgentXmppChannel *peer,
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/controller/controller_peer.h
Expand Up @@ -42,7 +42,7 @@ class AgentXmppChannel {
void ReceiveBgpMessage(std::auto_ptr<XmlBase> impl);

//Helper to identify if specified peer has active BGP peer attached
static bool IsBgpPeerActive(AgentXmppChannel *peer);
static bool IsBgpPeerActive(const Agent *agent, AgentXmppChannel *peer);
static bool SetConfigPeer(AgentXmppChannel *peer);
static void SetMulticastPeer(AgentXmppChannel *old_peer,
AgentXmppChannel *new_peer);
Expand Down
34 changes: 24 additions & 10 deletions src/vnsw/agent/controller/controller_route_path.cc
Expand Up @@ -169,17 +169,31 @@ bool ControllerVmRoute::AddChangePath(Agent *agent, AgentPath *path,
ret = true;
}

if (new_tunnel_type == TunnelType::VXLAN) {
if (path->vxlan_id() != label_) {
path->set_vxlan_id(label_);
path->set_label(MplsTable::kInvalidLabel);
ret = true;
}
//Interpret label sent by control node
if (tunnel_bmap_ == TunnelType::VxlanType()) {
//Only VXLAN encap is sent, so label is VXLAN
path->set_vxlan_id(label_);
path->set_label(MplsTable::kInvalidLabel);
} else if (tunnel_bmap_ == TunnelType::MplsType()) {
//MPLS (GRE/UDP) is the only encap sent,
//so label is MPLS.
path->set_label(label_);
path->set_vxlan_id(VxLanTable::kInvalidvxlan_id);
} else {
if (path->label() != label_) {
path->set_label(label_);
path->set_vxlan_id(VxLanTable::kInvalidvxlan_id);
ret = true;
//Got a mix of Vxlan and Mpls, so interpret label
//as per the computed tunnel type.
if (new_tunnel_type == TunnelType::VXLAN) {
if (path->vxlan_id() != label_) {
path->set_vxlan_id(label_);
path->set_label(MplsTable::kInvalidLabel);
ret = true;
}
} else {
if (path->label() != label_) {
path->set_label(label_);
path->set_vxlan_id(VxLanTable::kInvalidvxlan_id);
ret = true;
}
}
}

Expand Down

0 comments on commit bf9e767

Please sign in to comment.