summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index a98168d464..bbb7d5469d 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -206,10 +206,11 @@ static int bgp_ifp_destroy(struct interface *ifp)
{
struct bgp *bgp;
- bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
+ bgp = ifp->vrf->info;
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("Rx Intf del VRF %u IF %s", ifp->vrf_id, ifp->name);
+ zlog_debug("Rx Intf del VRF %u IF %s", ifp->vrf->vrf_id,
+ ifp->name);
if (bgp) {
bgp_update_interface_nbrs(bgp, ifp, NULL);
@@ -228,12 +229,13 @@ static int bgp_ifp_up(struct interface *ifp)
struct listnode *node, *nnode;
struct bgp *bgp;
- bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
+ bgp = ifp->vrf->info;
bgp_mac_add_mac_entry(ifp);
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("Rx Intf up VRF %u IF %s", ifp->vrf_id, ifp->name);
+ zlog_debug("Rx Intf up VRF %u IF %s", ifp->vrf->vrf_id,
+ ifp->name);
if (!bgp)
return 0;
@@ -258,12 +260,13 @@ static int bgp_ifp_down(struct interface *ifp)
struct bgp *bgp;
struct peer *peer;
- bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
+ bgp = ifp->vrf->info;
bgp_mac_del_mac_entry(ifp);
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("Rx Intf down VRF %u IF %s", ifp->vrf_id, ifp->name);
+ zlog_debug("Rx Intf down VRF %u IF %s", ifp->vrf->vrf_id,
+ ifp->name);
if (!bgp)
return 0;
@@ -875,7 +878,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
* It's fine to not have a v6 LL when using
* update-source loopback/vrf
*/
- if (!v6_ll_avail && if_is_loopback_or_vrf(ifp))
+ if (!v6_ll_avail && if_is_loopback(ifp))
v6_ll_avail = true;
} else
/* Link-local address. */
@@ -1249,6 +1252,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
uint8_t distance;
struct peer *peer;
struct bgp_path_info *mpinfo;
+ struct bgp *bgp_orig;
uint32_t metric;
struct attr local_attr;
struct bgp_path_info local_info;
@@ -1412,13 +1416,13 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
}
}
+ BGP_ORIGINAL_UPDATE(bgp_orig, mpinfo, bgp);
+
if (nh_family == AF_INET) {
nh_updated = update_ipv4nh_for_route_install(
- nh_othervrf,
- nh_othervrf ?
- info->extra->bgp_orig : bgp,
- &mpinfo_cp->attr->nexthop,
- mpinfo_cp->attr, is_evpn, api_nh);
+ nh_othervrf, bgp_orig,
+ &mpinfo_cp->attr->nexthop, mpinfo_cp->attr,
+ is_evpn, api_nh);
} else {
ifindex_t ifindex = IFINDEX_INTERNAL;
struct in6_addr *nexthop;
@@ -1428,18 +1432,13 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p,
if (!nexthop)
nh_updated = update_ipv4nh_for_route_install(
- nh_othervrf,
- nh_othervrf ? info->extra->bgp_orig
- : bgp,
+ nh_othervrf, bgp_orig,
&mpinfo_cp->attr->nexthop,
mpinfo_cp->attr, is_evpn, api_nh);
else
nh_updated = update_ipv6nh_for_route_install(
- nh_othervrf,
- nh_othervrf ? info->extra->bgp_orig
- : bgp,
- nexthop, ifindex, mpinfo, info, is_evpn,
- api_nh);
+ nh_othervrf, bgp_orig, nexthop, ifindex,
+ mpinfo, info, is_evpn, api_nh);
}
/* Did we get proper nexthop info to update zebra? */
@@ -3103,9 +3102,10 @@ static int bgp_ifp_create(struct interface *ifp)
struct bgp *bgp;
if (BGP_DEBUG(zebra, ZEBRA))
- zlog_debug("Rx Intf add VRF %u IF %s", ifp->vrf_id, ifp->name);
+ zlog_debug("Rx Intf add VRF %u IF %s", ifp->vrf->vrf_id,
+ ifp->name);
- bgp = bgp_lookup_by_vrf_id(ifp->vrf_id);
+ bgp = ifp->vrf->info;
if (!bgp)
return 0;