if (attr) {
bgp_update (peer, &p, 0, attr, afi, SAFI_ENCAP,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0);
-#if ENABLE_BGP_VNC
- rfapiProcessUpdate(peer, NULL, &p, &prd, attr, afi, SAFI_ENCAP,
- ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL);
-#endif
} else {
-#if ENABLE_BGP_VNC
- rfapiProcessWithdraw(peer, NULL, &p, &prd, attr, afi, SAFI_ENCAP,
- ZEBRA_ROUTE_BGP, 0);
-#endif
bgp_withdraw (peer, &p, 0, attr, afi, SAFI_ENCAP,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL);
}
safi_t safi;
int addpath_encoded;
u_int32_t addpath_id;
-#if ENABLE_BGP_VNC
- u_int32_t label = 0;
-#endif
/* Check peer status. */
if (peer->status != Established)
return -1;
}
-#if ENABLE_BGP_VNC
- label = decode_label (pnt);
-#endif
-
/* Copyr label to prefix. */
tagpnt = pnt;
{
bgp_update (peer, &p, addpath_id, attr, packet->afi, SAFI_MPLS_VPN,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt, 0);
-#if ENABLE_BGP_VNC
- rfapiProcessUpdate(peer, NULL, &p, &prd, attr, packet->afi,
- SAFI_MPLS_VPN, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
- &label);
-#endif
}
else
{
-#if ENABLE_BGP_VNC
- rfapiProcessWithdraw(peer, NULL, &p, &prd, attr, packet->afi,
- SAFI_MPLS_VPN, ZEBRA_ROUTE_BGP, 0);
-#endif
bgp_withdraw (peer, &p, addpath_id, attr, packet->afi, SAFI_MPLS_VPN,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, tagpnt);
}
struct rd_as rd_as;
struct rd_ip rd_ip = {0};
#if ENABLE_BGP_VNC
- struct rd_vnc_eth rd_vnc_eth;
+ struct rd_vnc_eth rd_vnc_eth = {0};
#endif
u_char *pnt;
struct rd_as rd_as;
struct rd_ip rd_ip = {0};
#if ENABLE_BGP_VNC
- struct rd_vnc_eth rd_vnc_eth;
+ struct rd_vnc_eth rd_vnc_eth = {0};
#endif
u_char *pnt;
bgp_process (bgp, rn, afi, safi);
bgp_unlock_node (rn);
+#if ENABLE_BGP_VNC
+ if (SAFI_MPLS_VPN == safi)
+ {
+ uint32_t label = decode_label(tag);
+
+ rfapiProcessUpdate(peer, NULL, p, prd, attr, afi, safi, type, sub_type,
+ &label);
+ }
+ if (SAFI_ENCAP == safi)
+ {
+ rfapiProcessUpdate(peer, NULL, p, prd, attr, afi, safi, type, sub_type,
+ NULL);
+ }
+#endif
+
return 0;
} // End of implicit withdraw
/* Process change. */
bgp_process (bgp, rn, afi, safi);
+#if ENABLE_BGP_VNC
+ if (SAFI_MPLS_VPN == safi)
+ {
+ uint32_t label = decode_label(tag);
+
+ rfapiProcessUpdate(peer, NULL, p, prd, attr, afi, safi, type, sub_type,
+ &label);
+ }
+ if (SAFI_ENCAP == safi)
+ {
+ rfapiProcessUpdate(peer, NULL, p, prd, attr, afi, safi, type, sub_type,
+ NULL);
+ }
+#endif
+
return 0;
/* This BGP update is filtered. Log the reason then update BGP
struct bgp_node *rn;
struct bgp_info *ri;
+#if ENABLE_BGP_VNC
+ if ((SAFI_MPLS_VPN == safi) || (SAFI_ENCAP == safi))
+ {
+ rfapiProcessWithdraw(peer, NULL, p, prd, NULL, afi, safi, type, 0);
+ }
+#endif
+
bgp = peer->bgp;
/* Lookup node. */
{
vnc_zlog_debug_verbose
- ("%s: trying bi=%p, bi->peer=%p, bi->type=%d, bi->sub_type=%d, bi->extra->vnc.export.rfapi_handle=%p",
+ ("%s: trying bi=%p, bi->peer=%p, bi->type=%d, bi->sub_type=%d, bi->extra->vnc.export.rfapi_handle=%p, local_pref=%u",
__func__, bi, bi->peer, bi->type, bi->sub_type,
- (bi->extra ? bi->extra->vnc.export.rfapi_handle : NULL));
+ (bi->extra ? bi->extra->vnc.export.rfapi_handle : NULL),
+ ((bi->attr && CHECK_FLAG(bi->attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))? bi->attr->local_pref: 0));
if (bi->peer == peer &&
bi->type == type &&
if (rn->info)
original_had_routes = 1;
+ if (VNC_DEBUG(VERBOSE))
+ {
+ vnc_zlog_debug_verbose ("%s: showing IT node on entry", __func__);
+ rfapiShowItNode (NULL, rn); /* debug */
+ }
+
/*
* Look for same route (will have same RD and peer)
*/