summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorpaul <paul>2004-11-04 20:35:31 +0000
committerpaul <paul>2004-11-04 20:35:31 +0000
commitf3ae74cdf0768d0bd35f26f728f72439f2d8bd6f (patch)
treef2bbe7f50336f1387cdddc0783573aeab1a2e41a /ospfd
parent49ff6d9d7a9ef9419dd7aab58ac9f7806e3e1040 (diff)
2004-11-04 Paul Jakma <paul@dishone.st>
* ospfd.c: (ospf_network_match_iface) revert to previous network statement match behaviour.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ChangeLog5
-rw-r--r--ospfd/ospfd.c32
2 files changed, 28 insertions, 9 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index e3efeb10..3adaeaf7 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-04 Paul Jakma <paul@dishone.st>
+
+ * ospfd.c: (ospf_network_match_iface) revert to previous network
+ statement match behaviour.
+
2004-11-02 Paul Jakma <paul@dishone.st>
* ospf_packet.c: (ospf_write_frags) remove iov arg, msg already points
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 054c3316..34a36ea4 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -686,17 +686,31 @@ ospf_network_match_iface(struct connected *co, struct prefix *net)
* PtP special case: network specified == iface peer addr -> ospf
*/
- /* For PtP, match if peer address matches network address exactly
- * in situations where the peer address is available and the prefix
- * length is 32 (i.e. a dedicated subnet has not been assigned).
- * This is not a test for falling within the prefix. This
+ /* 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 not PtP, accept if the address is within the prefix.
*/
- return CONNECTED_POINTOPOINT_HOST(co) ?
- IPV4_ADDR_SAME ( &(co->destination->u.prefix4), &(net->u.prefix4)) :
- prefix_match (net, co->address);
+ if (if_is_pointopoint (co->ifp) && co->destination &&
+ 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