summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-02-01 11:12:11 +0100
committerPaul Jakma <paul@quagga.net>2009-06-25 15:36:08 +0100
commit77a1c4e05ca5a7d7bf07456758f7c934ee867884 (patch)
tree47553373b16dd033a0866624dd54b8b851cbdb09 /ospfd
parentcbcd9bfc503f08b99f5360b1aae3a5362d25a665 (diff)
[ospfd] compare ifIndex too when matching paths
ospf_path_lookup(), ospf_route_match_same() and ospf_ase_route_match_same() needs to compare if the interface matches too.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_ase.c2
-rw-r--r--ospfd/ospf_route.c15
2 files changed, 13 insertions, 4 deletions
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 3eb29f8a..044f97c6 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -593,6 +593,8 @@ ospf_ase_route_match_same (struct route_table *rt, struct prefix *prefix,
if (! IPV4_ADDR_SAME (&op->nexthop, &newop->nexthop))
return 0;
+ if (op->oi->ifp->ifindex != newop->oi->ifp->ifindex)
+ return 0;
}
return 1;
}
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 50fba750..0829e8ea 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -165,6 +165,8 @@ ospf_route_match_same (struct route_table *rt, struct prefix_ipv4 *prefix,
if (! IPV4_ADDR_SAME (&op->nexthop, &newop->nexthop))
return 0;
+ if (op->oi->ifp->ifindex != newop->oi->ifp->ifindex)
+ return 0;
}
return 1;
}
@@ -827,10 +829,15 @@ ospf_path_lookup (struct list *plist, struct ospf_path *path)
struct ospf_path *op;
for (ALL_LIST_ELEMENTS_RO (plist, node, op))
- if (IPV4_ADDR_SAME (&op->nexthop, &path->nexthop) &&
- IPV4_ADDR_SAME (&op->adv_router, &path->adv_router))
- return op;
-
+ {
+ if (!IPV4_ADDR_SAME (&op->nexthop, &path->nexthop))
+ continue;
+ if (!IPV4_ADDR_SAME (&op->adv_router, &path->adv_router))
+ continue;
+ if (op->oi->ifp->ifindex != path->oi->ifp->ifindex)
+ continue;
+ return op;
+ }
return NULL;
}