]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Disable multiple OSPF pseudointerfaces on BSD.
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 26 Mar 2010 13:48:01 +0000 (14:48 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 26 Mar 2010 13:48:01 +0000 (14:48 +0100)
proto/ospf/iface.c
proto/ospf/ospf.c
proto/ospf/ospf.h
sysdep/cf/README
sysdep/cf/linux-22.h

index 987698e779ea0161c6c185536770db25cfa0fba0..b30a8112386b02c75734a69674435dd746aa9b1f 100644 (file)
@@ -423,7 +423,7 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface, struct ifa *addr,
   ifa->strictnbma = ip->strictnbma;
   ifa->waitint = ip->waitint;
   ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead;
-  ifa->stub = ip->stub;
+  ifa->stub = ospf_iface_stubby(ip, addr);
   ifa->ioprob = OSPF_I_OK;
   ifa->rxbuf = ip->rxbuf;
 
index e77156b79daa4042420dbd923d8786ffbc3b1635..e8245110a26b61003eaad5c4ea689ec55fc3a5af 100644 (file)
@@ -763,16 +763,17 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
        }
 
        /* stub */
-       if ((oldip->stub == 0) && (newip->stub != 0))
+       int old_stub = ospf_iface_stubby(oldip, ifa->addr);
+       int new_stub = ospf_iface_stubby(newip, ifa->addr);
+       if (!old_stub && new_stub)
        {
-         ifa->stub = newip->stub;
+         ifa->stub = 1;
          OSPF_TRACE(D_EVENTS, "Interface %s is now stub.", ifa->iface->name);
        }
-       if ((oldip->stub != 0) && (newip->stub == 0) && (ifa->ioprob == OSPF_I_OK))
+       if (old_stub && !new_stub && (ifa->ioprob == OSPF_I_OK))
        {
-         ifa->stub = newip->stub;
-         OSPF_TRACE(D_EVENTS,
-                    "Interface %s is no longer stub.", ifa->iface->name);
+         ifa->stub = 0;
+         OSPF_TRACE(D_EVENTS, "Interface %s is no longer stub.", ifa->iface->name);
        }
 
 #ifdef OSPFv2  
index 9e02d758e668417b34d92e1ac548825ab50abee5..ef51b9fdb12ccb8c2ecce1f8fe29518f091a085d 100644 (file)
@@ -772,6 +772,25 @@ struct ospf_iface_patt
 #endif
 };
 
+#if defined(OSPFv2) && !defined(CONFIG_MC_PROPER_SRC)
+static inline int
+ospf_iface_stubby(struct ospf_iface_patt *ip, struct ifa *addr)
+{
+  /*
+   * We cannot properly support multiple OSPF ifaces on real iface
+   * with multiple prefixes, therefore we force OSPF ifaces with
+   * non-primary IP prefixes to be stub.
+   */
+  return ip->stub || !(addr->flags & IA_PRIMARY);
+}
+#else
+static inline int
+ospf_iface_stubby(struct ospf_iface_patt *ip, struct ifa *addr UNUSED)
+{
+  return ip->stub;
+}
+#endif
+
 int ospf_import_control(struct proto *p, rte **new, ea_list **attrs,
                        struct linpool *pool);
 struct ea_list *ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool);
index deed866d47e283351f2b1d872e2c0c2c77dbd59e..15a45a65444a6ad5735044f0ba9ca869d0298b2b 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_AUTO_ROUTES      Device routes are added automagically by the kernel
 CONFIG_SELF_CONSCIOUS  We're able to recognize whether route was installed by us
 CONFIG_MULTIPLE_TABLES The kernel supports multiple routing tables
 CONFIG_ALL_TABLES_AT_ONCE      Kernel scanner wants to process all tables at once
+CONFIG_MC_PROPER_SRC   Multicast packets have source address according to socket saddr field
 
 CONFIG_UNIX_IFACE      Use Unix interface scanner
 CONFIG_UNIX_SET                Use Unix route setting
index 92ffb4cafa819f424389a7334afabad3346b671f..9ccab648f7b4e39729a45d8d5d32c0904c82f985 100644 (file)
@@ -10,6 +10,7 @@
 #define CONFIG_SELF_CONSCIOUS
 #define CONFIG_MULTIPLE_TABLES
 #define CONFIG_ALL_TABLES_AT_ONCE
+#define CONFIG_MC_PROPER_SRC
 
 #undef CONFIG_SKIP_MC_BIND