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

zebra: reset rtadv info on interface deletion #18220

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

Conversation

pguibert6WIND
Copy link
Member

On a BGP ipv6 with extended nexthop encoding, the deletion of an interface does not reset the rtadv per interface information.

Actually, if the same interface is readded, the rtadv information is still persistent:

dut-vm# show interface ntfp2
Interface ntfp2 is up, line protocol is up
Link ups: 2 last: 2025/02/21 11:28:14.10
Link downs: 4 last: 2025/02/21 11:14:22.60
vrf: default
index 4 metric 0 mtu 1500 speed 10000
flags: <UP,LOWER_UP,BROADCAST,RUNNING,MULTICAST>
Type: Ethernet
HWaddr: de:ed:02:f3:47:3d
inet6 2001:db8:0:1::1/64
inet6 fe80::dced:2ff:fef3:473d/64
Interface Type Other
Interface Slave Type None
protodown: off
ND advertised reachable time is 0 milliseconds
ND advertised retransmit interval is 0 milliseconds
ND advertised hop-count limit is 64 hops
ND router advertisements sent: 11 rcvd: 7
ND router advertisements are sent every 10 seconds
ND router advertisements lifetime tracks ra-interval
ND router advertisement default router preference is medium
Hosts use stateless autoconfig for addresses.

Actually, when deleting an interface, the interface is kept on default vrf with the original ifname but an ifindex set to 0. If BGP did not have time to undo the rtadv, then the rtadv configured is kept and is turned on, the next time the interface is used. Fix this by resetting the rtadv configuration at interface deletion.

When BGP is requested to leave (systemctl stop bgpd), BGP may not have
the time to flush all its contexts, including the rtadv information.

> Feb 21 14:32:23 dut-vm zebra[998]: [N5M5Y-J5BPG][EC 4043309121] Client 'bgp' (session id 1) encountered an error and is shutting down.
> Feb 21 14:32:23 dut-vm zebra[998]: [YDZ55-W3VM6] release_daemon_table_chunks: Released 0 table chunks
> Feb 21 14:32:23 dut-vm zebra[998]: [ZJPTG-6AP36] release_daemon_label_chunks: Releasing chunks for client proto bgp, instance 0, session 0
> Feb 21 14:32:23 dut-vm zebra[998]: [MP8WF-MBM3F] release_daemon_label_chunks: Released 0 label chunks
> Feb 21 14:32:23 dut-vm zebra[998]: [JPSA8-5KYEA] client 37 disconnected 0 bgp routes removed from the rib
> Feb 21 14:32:23 dut-vm zebra[998]: [S929C-NZR3N] client 37 disconnected 0 bgp nhgs removed from the rib
> Feb 21 14:32:23 dut-vm zebra[998]: [YDZ55-W3VM6] release_daemon_table_chunks: Released 0 table chunks
> Feb 21 14:32:23 dut-vm zebra[998]: [KQB7H-NPVW9] /build/make-pkg/output/_packages/cp-routing/src/zebra/zebra_ptm.c:1343 fai
> led to find process pid registration
> Feb 21 14:32:23 dut-vm zebra[998]: [ZJPTG-6AP36] release_daemon_label_chunks: Releasing chunks for client proto bgp, instan
> ce 0, session 1
> Feb 21 14:32:23 dut-vm zebra[998]: [WAX6A-X2VK5] Releasing label chunk: 103 - 103
> Feb 21 14:32:23 dut-vm zebra[998]: [MP8WF-MBM3F] release_daemon_label_chunks: Released 1 label chunks
> Feb 21 14:32:23 dut-vm zebra[998]: [JPSA8-5KYEA] client 42 disconnected 0 bgp routes removed from the rib
> Feb 21 14:32:23 dut-vm zebra[998]: [S929C-NZR3N] client 42 disconnected 0 bgp nhgs removed from the rib
> Feb 21 14:32:31 dut-vm zebra[998]: [JY2SR-KEYTH] ntfp2(default:4): Tx RA, socket 9

When the BGP leave is detected by ZEBRA, one should ensure that no
interfaces have rtadvd enabled by BGP.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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.

1 participant