]> git.puffer.fish Git - mirror/frr.git/commitdiff
* ospfd.c (ospf_network_match_iface): Rewrite code for clarity
authorgdt <gdt>
Fri, 5 Dec 2003 14:01:43 +0000 (14:01 +0000)
committergdt <gdt>
Fri, 5 Dec 2003 14:01:43 +0000 (14:01 +0000)
while trying not to change semantics.  Add ifdefed-out code to
avoid matching ppp interfaces whose destination address does not
also match the prefix under consideration, to help out people with
problems due to as-yet-unfixed bugs with p2p interfaces coming and
going.

ospfd/ChangeLog
ospfd/ospfd.c

index 27454aa28f36abcc30d40780a7e88333150adb81..d294a22037ccf68a01f21822f5bbdd3ec89bb5e1 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-05  Greg Troxel  <gdt@poblano.ir.bbn.com>
+
+       * ospfd.c (ospf_network_match_iface): Rewrite code for clarity
+       while trying not to change semantics.  Add ifdefed-out code to
+       avoid matching ppp interfaces whose destination address does not
+       also match the prefix under consideration, to help out people with
+       problems due to as-yet-unfixed bugs with p2p interfaces coming and
+       going.
+
 2003-07-25 kamatchi soundaram <kamatchi@tdd.sj.nec.com>
 
         * ospf_packet.c (ospf_ls_upd_send_queue_event): get next route
index 50cb49b7a924aefa69252ab23d35a0d67610d0c6..89ef21b176c66a3ed14353b821ff6ec23a074d18 100644 (file)
@@ -713,12 +713,32 @@ ospf_network_match_iface(struct connected *co, struct prefix *net)
    * and zebra 0.9[2ish-3]:
    *   PtP special case: network specified == iface peer addr -> ospf
    */
-  return (
-          ((if_is_pointopoint (co->ifp) && 
-            IPV4_ADDR_SAME ( &(co->destination->u.prefix4), &(net->u.prefix4)))
-                 || prefix_match (net, co->address)) 
-                 ? 1 : 0
-                );
+
+  /* For PtP, match if peer address matches network address exactly.
+   * This can be addr/32 or addr/p for p < 32, but the addr must match
+   * exactly; this is not a test for falling within the prefix.  This
+   * test is solely for compatibility with zebra.
+  */
+  if (if_is_pointopoint (co->ifp) && 
+      IPV4_ADDR_SAME ( &(co->destination->u.prefix4), &(net->u.prefix4)))
+    return 1;
+
+#if 0
+  /* Decline to accept PtP if dst address does not match the
+   * prefix. (ifdefed out because this is a workaround, not the
+   * desired behavior.) */
+  if (if_is_pointopoint (co->ifp) &&
+      ! prefix_match (net, co->destination))
+    return 0;
+#endif
+
+  /* If the address is within the prefix, accept.  Note that this
+   * applies to PtP as well as other types.
+   */
+  if (prefix_match (net, co->address))
+    return 1;
+
+  return 0;                    /* no match */
 }
 
 void