forked from Mirror/frr
lib: add function to get iface link-local
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
85467974e8
commit
667179cae4
13
lib/if.c
13
lib/if.c
|
@ -904,6 +904,19 @@ struct connected *connected_add_by_prefix(struct interface *ifp,
|
|||
return ifc;
|
||||
}
|
||||
|
||||
struct connected *connected_get_linklocal(struct interface *ifp)
|
||||
{
|
||||
struct listnode *n;
|
||||
struct connected *c = NULL;
|
||||
|
||||
for (ALL_LIST_ELEMENTS_RO(ifp->connected, n, c)) {
|
||||
if (c->address->family == AF_INET6
|
||||
&& IN6_IS_ADDR_LINKLOCAL(&c->address->u.prefix6))
|
||||
break;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
#if 0 /* this route_table of struct connected's is unused \
|
||||
* however, it would be good to use a route_table rather than \
|
||||
* a list.. \
|
||||
|
|
1
lib/if.h
1
lib/if.h
|
@ -542,6 +542,7 @@ extern struct connected *connected_lookup_prefix_exact(struct interface *,
|
|||
extern struct nbr_connected *nbr_connected_new(void);
|
||||
extern void nbr_connected_free(struct nbr_connected *);
|
||||
struct nbr_connected *nbr_connected_check(struct interface *, struct prefix *);
|
||||
struct connected *connected_get_linklocal(struct interface *ifp);
|
||||
|
||||
/* link parameters */
|
||||
struct if_link_params *if_link_params_get(struct interface *);
|
||||
|
|
Loading…
Reference in a new issue