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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

routingrocks
Copy link
Contributor

Issue:
In a dual-stack IPv4/IPv6 BGP session, after the interface is deactivated (ifdown) and then reloaded (ifreload), the global next-hop within BGP is incorrectly updated. Currently, only unnumbered neighbors are handled.
We also need to handle an IPv4 neighbor when IPv6 AFI-SAFI is enabled.

Fix:
When the primary global v6 unicast address is received from Zebra, BGP updates the peer's global next-hop with the correct address and send update to its negibors.

Testing: UT, and TestEbgpMultihop tests

UT logs:
with fix:
root@:mgmt:/tmp# ifdown swp1s0; ifreload -a root@:mgmt:/tmp# vtysh -c "show ip bgp vrf all neighbors" | grep Nexthop Nexthop: 20.1.2.101
Nexthop global: 2001:10:1:2::101
Nexthop local: fe80::7efe:90ff:fefa:e158

without fix after ifreload:
Nexthop: 20.1.2.101
Nexthop global: ::
Nexthop local: fe80::7efe:90ff:fefa:e158

Ticket: #
Signed-off-by: Rajesh Varatharaj [email protected] and Pooja Doijode [email protected]

Issue:
In a dual-stack IPv4/IPv6 BGP session, after the interface is deactivated (ifdown)
and then reloaded (ifreload), the global next-hop within BGP is incorrectly updated.
Currently, only unnumbered neighbors are handled.
We also need to handle an IPv4 neighbor when IPv6 AFI-SAFI is enabled.

Fix:
When the primary global v6 unicast address is received from Zebra,
BGP updates the peer's global next-hop with the correct address and
send update to its negibors.

Testing: UT, and TestEbgpMultihop tests

UT logs:
with fix:
root@cumulus:mgmt:/tmp# ifdown swp1s0; ifreload -a
root@:mgmt:/tmp# vtysh -c "show ip bgp vrf all neighbors" | grep Nexthop
Nexthop: 20.1.2.101
Nexthop global: 2001:10:1:2::101
Nexthop local: fe80::7efe:90ff:fefa:e158

without fix after ifreload:
Nexthop: 20.1.2.101
Nexthop global: ::
Nexthop local: fe80::7efe:90ff:fefa:e158

Ticket: #3870831
Signed-off-by: Rajesh Varatharaj <[email protected]> and Pooja Doijode [email protected]
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

Please fix the Signed-off tag, to be two separate tags, instead of as it is for now.

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?

@ton31337
Copy link
Member

ton31337 commented May 4, 2024

@Mergifyio backport stable/10.0

Copy link

mergify bot commented May 4, 2024

backport stable/10.0

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

looks good other than @ton31337 's comments ...

@ton31337
Copy link
Member

@routingrocks could you rebase?

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@louis-6wind
Copy link
Contributor

louis-6wind commented May 13, 2024

Normally, the issue is fixed by #15614, which is now merged
Could you test your scenario with the latest master branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants