]> git.proxmox.com Git - mirror_frr.git/commit - zebra/zebra_vrf.c
zebra: rework RA handling for vrf-lite
authorStephen Worley <sworley@nvidia.com>
Wed, 26 May 2021 21:36:16 +0000 (17:36 -0400)
committerStephen Worley <sworley@nvidia.com>
Tue, 8 Jun 2021 19:05:43 +0000 (15:05 -0400)
commit7c2ddfb976af93b373bccf080ab228ce4b097244
tree3819c521aa6d4ba465cc5f560cf52027dc536096
parentfdb7f5d54f94225b0f70709ef44b06d10b59f535
zebra: rework RA handling for vrf-lite

Rework RA handling for vrf-lite scenarios.

Before we were using a single FD descriptor for polling
across multiple zvrf's. This would cause us to hit this
assert() in some bgp unnumbered and vrrp configs:

```
/*
 * What happens if we have a thread already
 * created for this event?
 */
if (thread_array[fd])
assert(!"Thread already scheduled for file descriptor");
```

We were scheduling a thread_read on the same FD for every zvrf.

With vrf-lite, RAs and ARPs are not vrf-bound, so we can just use one
rtadv instance to manage them for all VRFs. We will choose the default
VRF for this.

This patch removes the rtadv_sock altogether for zrouter and moves the
functionality this represented to the default VRF. All RAs will be
handled in the default VRF under vrf-lite configs with only one poll
thread started for it.

This patch also extends how we track subscribed interfaces (s or msec)
to use an actual sorted list by interface names rather than just a
counter. With multiple daemons turning interfaces/on/off these counters
can get very wrong during ifup/down events. Making them a sorted list
prevents this from happening by preventing duplicates.

With netns-vrf's nothing should change other than the interface list.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
zebra/main.c
zebra/rib.h
zebra/rtadv.c
zebra/rtadv.h
zebra/zebra_router.c
zebra/zebra_router.h
zebra/zebra_vrf.c