diff options
Diffstat (limited to 'zebra/connected.c')
-rw-r--r-- | zebra/connected.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 5f581915..3ce59530 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -41,13 +41,10 @@ connected_check_ipv4 (struct interface *ifp, struct prefix *p) struct connected *ifc; struct listnode *node; - for (node = listhead (ifp->connected); node; node = nextnode (node)) - { - ifc = getdata (node); + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) + if (prefix_same (ifc->address, p)) + return ifc; - if (prefix_same (ifc->address, p)) - return ifc; - } return NULL; } @@ -267,13 +264,10 @@ connected_check_ipv6 (struct interface *ifp, struct prefix *p) struct connected *ifc; struct listnode *node; - for (node = listhead (ifp->connected); node; node = nextnode (node)) - { - ifc = getdata (node); + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) + if (prefix_same (ifc->address, p)) + return ifc; - if (prefix_same (ifc->address, p)) - return ifc; - } return 0; } |