diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2023-08-23 15:55:31 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-08-23 16:08:40 +0200 |
commit | e3c0eca95642a846ab65261424a51dd99d954017 (patch) | |
tree | e108f29222cd8b62a40f7b05360c05b9f34d3b9a /nest/iface.c | |
parent | 5121101136cb80151a9361c63dc4822afeb44eef (diff) |
Nest: Treat VRF interfaces as inside respective VRFs
Despite not having defined 'master interface', VRF interfaces should be
treated as being inside respective VRFs. They behave as a loopback for
respective VRFs. Treating the VRF interface as inside the VRF allows
e.g. OSPF to pick up IP addresses defined on the VRF interface.
For this, we also need to tell apart VRF interfaces and regular interfaces.
Extend Netlink code to parse interface type and mark VRF interfaces with
IF_VRF flag.
Based on the patch from Erin Shepherd, thanks!
Diffstat (limited to 'nest/iface.c')
-rw-r--r-- | nest/iface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nest/iface.c b/nest/iface.c index 682340c5..6c84cbcf 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -147,7 +147,7 @@ ifa_send_notify(struct proto *p, unsigned c, struct ifa *a) { if (p->ifa_notify && (p->proto_state != PS_DOWN) && - (!p->vrf_set || p->vrf == a->iface->master)) + (!p->vrf_set || if_in_vrf(a->iface, p->vrf))) { if (p->debug & D_IFACES) log(L_TRACE "%s < address %N on interface %s %s", @@ -185,7 +185,7 @@ if_send_notify(struct proto *p, unsigned c, struct iface *i) { if (p->if_notify && (p->proto_state != PS_DOWN) && - (!p->vrf_set || p->vrf == i->master)) + (!p->vrf_set || if_in_vrf(i, p->vrf))) { if (p->debug & D_IFACES) log(L_TRACE "%s < interface %s %s", p->name, i->name, |