]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
VRF: Fix issues with reconfiguration
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 22 Jan 2023 17:12:04 +0000 (18:12 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 22 Jan 2023 17:21:08 +0000 (18:21 +0100)
Protocols receive if_notify() announcements that are filtered according
to their VRF setting, but during reconfiguration, they access iface_list
directly and forgot to check VRF setting here, which leads to all
interfaces be addedd.

Fix this issue for Babel, OSPF, RAdv and RIP protocols.

Thanks to Marcel Menzel for the bugreport.

proto/babel/babel.c
proto/ospf/iface.c
proto/radv/radv.c
proto/rip/rip.c

index ecde07b3f74d32933336ac1d69a76cca83b25238..ff8b6b52ef4a3f3c06f1447ec452c246d2841716 100644 (file)
@@ -1946,6 +1946,9 @@ babel_reconfigure_ifaces(struct babel_proto *p, struct babel_config *cf)
 
   WALK_LIST(iface, iface_list)
   {
+    if (p->p.vrf_set && p->p.vrf != iface->master)
+      continue;
+
     if (!(iface->flags & IF_UP))
       continue;
 
index 4cd4503318ec1f96bcd6a7ae5735c18bae9f1f84..87e3d95eb6aecbd8ab06b66216dc06c9b39c5cb7 100644 (file)
@@ -1227,6 +1227,9 @@ ospf_reconfigure_ifaces2(struct ospf_proto *p)
 
   WALK_LIST(iface, iface_list)
   {
+    if (p->p.vrf_set && p->p.vrf != iface->master)
+      continue;
+
     if (! (iface->flags & IF_UP))
       continue;
 
@@ -1273,6 +1276,9 @@ ospf_reconfigure_ifaces3(struct ospf_proto *p)
 
   WALK_LIST(iface, iface_list)
   {
+    if (p->p.vrf_set && p->p.vrf != iface->master)
+      continue;
+
     if (! (iface->flags & IF_UP))
       continue;
 
index 541c398613a85599bf200370ec4c302bdd89da45..119a8dc41c980d4cfe9209c1b2757a84cd3507ae 100644 (file)
@@ -663,6 +663,9 @@ radv_reconfigure(struct proto *P, struct proto_config *CF)
   struct iface *iface;
   WALK_LIST(iface, iface_list)
   {
+    if (p->p.vrf_set && p->p.vrf != iface->master)
+      continue;
+
     if (!(iface->flags & IF_UP))
       continue;
 
index 5f3161ee0f64d234b260471fabd8b5f594048672..8c2d5aebdee75829b13e0d8895b027f89552d515 100644 (file)
@@ -797,6 +797,9 @@ rip_reconfigure_ifaces(struct rip_proto *p, struct rip_config *cf)
 
   WALK_LIST(iface, iface_list)
   {
+    if (p->p.vrf_set && p->p.vrf != iface->master)
+      continue;
+
     if (!(iface->flags & IF_UP))
       continue;