diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-29 23:44:12 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-30 09:34:03 -0400 |
| commit | 07b17d5927499beaf42665bb7bd2bcaea0b1e9d6 (patch) | |
| tree | e55d9084652b7a2087dff3b3e7325306beae0b82 /pimd/pim_iface.c | |
| parent | 7399328a6fbd9e41e03cc8d0c9bfbf16a5738c9a (diff) | |
pimd: Add code to find neighbor by secondary
With RFC 5549 we need a methodology to find
a neighbor based upon a nexthop that is
v6 based. This commit sets us up for that
by allowing you to find the neigbor by
the secondary list. In a future commit
we will add code to pass the v6 secondary
addresses.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_iface.c')
| -rw-r--r-- | pimd/pim_iface.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 0864796431..a753cc4aff 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1105,6 +1105,7 @@ struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp, struct listnode *neighnode; struct pim_neighbor *neigh; struct pim_interface *pim_ifp; + struct prefix p; zassert(ifp); @@ -1116,6 +1117,10 @@ struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp, return 0; } + p.family = AF_INET; + p.u.prefix4 = addr; + p.prefixlen = IPV4_MAX_PREFIXLEN; + for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, neighnode, neigh)) { /* primary address ? */ @@ -1123,7 +1128,7 @@ struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp, return neigh; /* secondary address ? */ - if (pim_neighbor_find_secondary(neigh, addr)) + if (pim_neighbor_find_secondary(neigh, &p)) return neigh; } |
