summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-02-11 21:52:13 +0000
committerhasso <hasso>2004-02-11 21:52:13 +0000
commit2db3d05da3ac6b1ff9452a5f291bfc39a719d1c6 (patch)
tree41cceb234a9b0cfb6410574689cd800671456b55 /ospfd/ospf_interface.c
parentcb05eb285f28524ada2df62c5522dcf47acb841b (diff)
Don't crash when attempting to read path->oi->ifp if oi doesn't exist any
more. I'm not sure if this read should be attempted at all, but I'm trying to keep code safe AND stable.
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 2afe19ec..2f94b43f 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -371,6 +371,23 @@ ospf_if_is_up (struct ospf_interface *oi)
}
struct ospf_interface *
+ospf_if_exists (struct ospf_interface *oic)
+{
+ listnode node;
+ struct ospf *ospf;
+ struct ospf_interface *oi;
+
+ ospf = ospf_lookup ();
+
+ for (node = listhead (ospf->oiflist); node; nextnode (node))
+ {
+ if (((oi = getdata (node)) != NULL) && (oi == oic))
+ return oi;
+ }
+ return NULL;
+}
+
+struct ospf_interface *
ospf_if_lookup_by_local_addr (struct ospf *ospf,
struct interface *ifp, struct in_addr address)
{