diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2014-03-18 17:04:25 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2014-03-18 17:04:25 +0100 |
commit | e708ed69aa0b993527f48b1f31b645c00750927f (patch) | |
tree | 8f33d73b2a85b51c042318d58a1750eeb8019616 /lib/if.c | |
parent | a11e012e8661629d665e992e765741a5eaa7d017 (diff) | |
parent | 424cc3bd48da0f417c9056c5c2ade697a3386cd4 (diff) | |
download | quagga-e708ed69aa0b993527f48b1f31b645c00750927f.tar.bz2 quagga-e708ed69aa0b993527f48b1f31b645c00750927f.tar.xz |
Merge volatile/cumulus_ospf6d
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/if.c')
-rw-r--r-- | lib/if.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -304,6 +304,30 @@ if_lookup_address (struct in_addr src) return match; } +/* Lookup interface by prefix */ +struct interface * +if_lookup_prefix (struct prefix *prefix) +{ + struct listnode *node; + struct prefix addr; + int bestlen = 0; + struct listnode *cnode; + struct interface *ifp; + struct connected *c; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) + { + if (prefix_cmp(c->address, prefix) == 0) + { + return ifp; + } + } + } + return NULL; +} + /* Get interface by name if given name interface doesn't exist create one. */ struct interface * |