diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-01-25 21:48:17 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 00:27:08 +0000 |
| commit | 667179cae42b6d39db7a0bb1f76b7591f26e720f (patch) | |
| tree | 7a0aae1206aa8342dff659fe563b8049a49bc94c /lib/if.c | |
| parent | 85467974e8abcd5517e7cc6c67574c1d4c9f19b0 (diff) | |
lib: add function to get iface link-local
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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.. \ |
