diff options
author | paul <paul> | 2005-04-07 09:30:20 +0200 |
---|---|---|
committer | paul <paul> | 2005-04-07 09:30:20 +0200 |
commit | 1eb8ef2584833f18fb674e127d59cb5a7f771482 (patch) | |
tree | f5b09d4781de9a9b08839fefb6530e64d2d2ec31 /zebra/irdp_interface.c | |
parent | * lib/prefix.[hc]: inet6_ntoa utility function copied from (diff) | |
download | frr-1eb8ef2584833f18fb674e127d59cb5a7f771482.tar.xz frr-1eb8ef2584833f18fb674e127d59cb5a7f771482.zip |
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
and some basic auditing of usage.
* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
* HACKING: Add notes about deprecating interfaces and commands.
* lib/linklist.h: Add usage comments.
Rename getdata macro to listgetdata.
Rename nextnode to listnextnode and fix its odd behaviour to be
less dangerous.
Make listgetdata macro assert node is not null, NULL list entries
should be bug condition.
ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
with for loop, Suggested by Jim Carlson of Sun.
Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
"safety" of previous macro.
LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
distinguish from the similarly named functions, and reflect their
effect better.
Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
with the old defines which were modified above,
for backwards compatibility - guarded to prevent Quagga using it..
* lib/linklist.c: fix up for linklist.h changes.
* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
scan of the area list, rather than scanning all areas first for
INTER_ROUTER and then again for INTER_NETWORK. According to
16.2, the scan should be area specific anyway, and further
ospf6d does not seem to implement 16.3 anyway.
Diffstat (limited to 'zebra/irdp_interface.c')
-rw-r--r-- | zebra/irdp_interface.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 5f913856b..dd7734026 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -81,7 +81,7 @@ irdp_get_prefix(struct interface *ifp) struct connected *ifc; if (ifp->connected) - LIST_LOOP (ifp->connected, ifc, node) + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) return ifc->address; return NULL; @@ -235,7 +235,7 @@ irdp_if_start(struct interface *ifp, int multicast, int set_defaults) seed = 0; if( ifp->connected) - LIST_LOOP (ifp->connected, ifc, node) + for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) { seed = ifc->address->u.prefix4.s_addr; break; @@ -355,7 +355,7 @@ void irdp_config_write (struct vty *vty, struct interface *ifp) vty_out (vty, " ip irdp preference %ld%s", irdp->Preference, VTY_NEWLINE); - LIST_LOOP (irdp->AdvPrefList, adv, node) + for (ALL_LIST_ELEMENTS_RO (irdp->AdvPrefList, node, adv)) vty_out (vty, " ip irdp address %s preference %d%s", inet_2a(adv->ip.s_addr, b1), adv->pref, @@ -610,7 +610,7 @@ DEFUN (ip_irdp_address_preference, pref = atoi(argv[1]); - LIST_LOOP (irdp->AdvPrefList, adv, node) + for (ALL_LIST_ELEMENTS_RO (irdp->AdvPrefList, node, adv)) if(adv->ip.s_addr == ip.s_addr) return CMD_SUCCESS; @@ -656,11 +656,8 @@ DEFUN (no_ip_irdp_address_preference, pref = atoi(argv[1]); - for (node = listhead (irdp->AdvPrefList); node; node = nnode) + for (ALL_LIST_ELEMENTS (irdp->AdvPrefList, node, nnode, adv)) { - nnode = node->next; - adv = getdata (node); - if(adv->ip.s_addr == ip.s_addr ) { listnode_delete(irdp->AdvPrefList, adv); |