Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Fix BGP to update correct v6 next-hop globally #15919

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,18 @@ static int bgp_interface_address_add(ZAPI_CALLBACK_ARGS)
continue;

/*
* If the Peer's interface name matches the
* interface name for which BGP received the
* update and if the received interface address
* is a globalV6 and if the peer is currently
* Is a globalV6 and if the peer is currently
* using a v4-mapped-v6 addr or a link local
* address, then copy the Rxed global v6 addr
* into peer's v6_global and send updates out
* with new nexthop addr.
* Making sure peer nexthop ifname in sync with
* local ifname. peer->su.sin6.sin6_scope_id can
* be used only for unnumbered.
*/
if ((peer->conf_if &&
(strcmp(peer->conf_if, ifc->ifp->name) ==
0)) &&
if ((peer->nexthop.ifp &&
(strcmp(peer->nexthop.ifp->name,
ifc->ifp->name) == 0)) &&
!IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix6) &&
((IS_MAPPED_IPV6(
&peer->nexthop.v6_global)) ||
Expand Down
9 changes: 6 additions & 3 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -4309,13 +4309,16 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
zif->link_ifindex);
if (!link_if)
return 0;
} else if (IS_ZEBRA_IF_BRIDGE(ifp))
} else if (IS_ZEBRA_IF_BRIDGE(ifp)) {
link_if = ifp;
else {
} else {
link_if = NULL;
char ip_buf[ETHER_ADDR_STRLEN];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this above link_if and a newline after variables (same is suggested by frrbot/verify check).

if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(
" Neighbor Entry received is not on a VLAN or a BRIDGE, ignoring");
" Neighbor Entry IF %s(%u) and IP %s is not on a VLAN or BRIDGE, ignoring",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: and IP can it be one whitespace?

ifp->name, ndm->ndm_ifindex,
ipaddr2str(&ip, ip_buf, sizeof(ip_buf)));
}

memset(&mac, 0, sizeof(mac));
Expand Down
Loading