diff options
Diffstat (limited to 'bgpd/bgp_zebra.c')
| -rw-r--r-- | bgpd/bgp_zebra.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 2c7c087855..5ef49e5108 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -517,8 +517,8 @@ static int zebra_read_route(ZAPI_CALLBACK_ARGS) /* Now perform the add/update. */ bgp_redistribute_add(bgp, &api.prefix, &nexthop, ifindex, - nhtype, api.metric, api.type, api.instance, - api.tag); + nhtype, api.distance, api.metric, api.type, + api.instance, api.tag); } else { bgp_redistribute_delete(bgp, &api.prefix, api.type, api.instance); @@ -838,6 +838,12 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote, if (direct) v6_ll_avail = if_get_ipv6_local( ifp, &nexthop->v6_local); + /* + * 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)) + v6_ll_avail = true; } else /* Link-local address. */ { @@ -1543,6 +1549,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, label_buf[0] = '\0'; eth_buf[0] = '\0'; + segs_buf[0] = '\0'; if (has_valid_label && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) snprintf(label_buf, sizeof(label_buf), @@ -2576,6 +2583,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s, stream_putl(s, pbr->unique); else stream_putl(s, pbra->unique); + stream_putc(s, 0); /* ip protocol being used */ if (pbr && pbr->flags & MATCH_IP_SRC_SET) memcpy(&pfx, &(pbr->src), sizeof(struct prefix)); else { @@ -3315,6 +3323,13 @@ void bgp_zebra_announce_default(struct bgp *bgp, struct nexthop *nh, && nh->type != NEXTHOP_TYPE_IPV6) || nh->vrf_id == VRF_UNKNOWN) return; + + /* in vrf-lite, no default route has to be announced + * the table id of vrf is directly used to divert traffic + */ + if (!vrf_is_backend_netns() && bgp->vrf_id != nh->vrf_id) + return; + memset(&p, 0, sizeof(struct prefix)); if (afi != AFI_IP && afi != AFI_IP6) return; |
