summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-07-27 12:42:29 +0200
committerPaul Jakma <paul@quagga.net>2009-07-28 18:40:47 +0100
commitf0f63841582ed97362619a53fb711747f09d961b (patch)
treebb663103d3b25064143685a4f3f40cd008b3cc0f
parent2158ad2359a370dd349f4543a2d5d535bb5a8770 (diff)
ospfd: export ospf_if_table_lookup() and use it in ospf_network_run_interface()
Makes it possible to run OSPF on multiple PtP interfaces with the same remote address. * ospfd/ospf_interface.c: Export ospf_if_table_lookup(). * ospfd/ospf_interface.h: ditto. * ospfd/ospfd.c: (ospf_network_run_interface) Use ospf_if_table_lookup() to determine whether OSPF is already configured for a subnet and interface.
-rw-r--r--ospfd/ospf_interface.c2
-rw-r--r--ospfd/ospf_interface.h2
-rw-r--r--ospfd/ospfd.c7
3 files changed, 5 insertions, 6 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 951c19a8..4eccee76 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -145,7 +145,7 @@ ospf_if_reset_variables (struct ospf_interface *oi)
}
/* lookup oi for specified prefix/ifp */
-static struct ospf_interface *
+struct ospf_interface *
ospf_if_table_lookup (struct interface *ifp, struct prefix *prefix)
{
struct prefix p;
diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h
index 79b178d8..0fc4ccba 100644
--- a/ospfd/ospf_interface.h
+++ b/ospfd/ospf_interface.h
@@ -248,6 +248,8 @@ extern struct ospf_interface *ospf_if_lookup_by_local_addr (struct ospf *,
struct in_addr);
extern struct ospf_interface *ospf_if_lookup_by_prefix (struct ospf *,
struct prefix_ipv4 *);
+extern struct ospf_interface *ospf_if_table_lookup (struct interface *,
+ struct prefix *);
extern struct ospf_interface *ospf_if_addr_local (struct in_addr);
extern struct ospf_interface *ospf_if_lookup_recv_if (struct ospf *,
struct in_addr);
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 08e41005..b86986b5 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -901,15 +901,12 @@ ospf_network_run_interface (struct prefix *p, struct ospf_area *area,
then create socket and join multicast group. */
for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, co))
{
- struct prefix *addr;
-
+
if (CHECK_FLAG(co->flags,ZEBRA_IFA_SECONDARY))
continue;
- addr = CONNECTED_ID(co);
-
if (p->family == co->address->family
- && ! ospf_if_is_configured (area->ospf, &(addr->u.prefix4))
+ && ! ospf_if_table_lookup(ifp, co->address)
&& ospf_network_match_iface(co,p))
{
struct ospf_interface *oi;