return NULL;
}
-/* determine receiving interface by source of packet */
+/* determine receiving interface by ifp and source address */
struct ospf_interface *
-ospf_if_lookup_recv_if (struct ospf *ospf, struct in_addr src)
+ospf_if_lookup_recv_if (struct ospf *ospf, struct in_addr src,
+ struct interface *ifp)
{
- struct listnode *node;
+ struct route_node *rn;
struct prefix_ipv4 addr;
struct ospf_interface *oi, *match;
match = NULL;
- for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
+ for (rn = route_top (IF_OIFS (ifp)); rn; rn = route_next (rn))
{
+ oi = rn->info;
+
+ if (!oi) /* oi can be NULL for PtP aliases */
+ continue;
+
if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
continue;
-
+
if (if_is_loopback (oi->ifp))
continue;
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);
+ struct in_addr,
+ struct interface *);
extern struct ospf_interface *ospf_if_is_configured (struct ospf *,
struct in_addr *);
ospfh = (struct ospf_header *) STREAM_PNT (ibuf);
/* associate packet with ospf interface */
- oi = ospf_if_lookup_recv_if (ospf, iph->ip_src);
+ oi = ospf_if_lookup_recv_if (ospf, iph->ip_src, ifp);
/* If incoming interface is passive one, ignore it. */
if (oi && OSPF_IF_PASSIVE_STATUS (oi) == OSPF_IF_PASSIVE)
return 0;
}
}
-
+
/* else it must be a local ospf interface, check it was received on
* correct link
*/