summaryrefslogtreecommitdiff
path: root/proto/bgp
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-08-23 15:55:31 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-23 16:08:40 +0200
commite3c0eca95642a846ab65261424a51dd99d954017 (patch)
treee108f29222cd8b62a40f7b05360c05b9f34d3b9a /proto/bgp
parent5121101136cb80151a9361c63dc4822afeb44eef (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 'proto/bgp')
-rw-r--r--proto/bgp/packets.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index ee98115d..dc52e805 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1179,7 +1179,7 @@ bgp_use_gateway(struct bgp_export_state *s)
return 0;
/* Do not use gateway from different VRF */
- if (p->p.vrf_set && ra->nh.iface && (p->p.vrf != ra->nh.iface->master))
+ if (p->p.vrf_set && ra->nh.iface && !if_in_vrf(ra->nh.iface, p->p.vrf))
return 0;
/* Use it when exported to internal peers */