summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-11-22 19:05:41 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2023-11-22 23:00:30 +0100
commit8b23c0b0bd3470babe8702f54a47bb223f471b14 (patch)
tree07e92fbef506de160930385036fd69901b59e6a6 /ripngd
parentMerge pull request #14830 from fdumontet6WIND/snmpv2 (diff)
downloadfrr-8b23c0b0bd3470babe8702f54a47bb223f471b14.tar.xz
frr-8b23c0b0bd3470babe8702f54a47bb223f471b14.zip
*: convert `struct interface->connected` to DLIST
Replace `struct list *` with `DLIST(if_connected, ...)`. NB: while converting this, I found multiple places using connected prefixes assuming they were IPv4 without checking: - vrrpd/vrrp.c: vrrp_socket() - zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(), irdp_advert_off() (these fixes are really hard to split off into separate commits as that would require going back and reapplying the change but with the old list handling) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripng_interface.c9
-rw-r--r--ripngd/ripngd.c3
2 files changed, 4 insertions, 8 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index aa470aa65..35d92632a 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -128,11 +128,10 @@ static int ripng_multicast_leave(struct interface *ifp, int sock)
/* How many link local IPv6 address could be used on the interface ? */
static int ripng_if_ipv6_lladdress_check(struct interface *ifp)
{
- struct listnode *nn;
struct connected *connected;
int count = 0;
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, nn, connected)) {
+ frr_each (if_connected, ifp->connected, connected) {
struct prefix *p;
p = connected->address;
@@ -408,14 +407,13 @@ static int ripng_enable_network_lookup_if(struct interface *ifp)
{
struct ripng_interface *ri = ifp->info;
struct ripng *ripng = ri->ripng;
- struct listnode *node;
struct connected *connected;
struct prefix_ipv6 address;
if (!ripng)
return -1;
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
+ frr_each (if_connected, ifp->connected, connected) {
struct prefix *p;
struct agg_node *n;
@@ -590,11 +588,10 @@ static void ripng_connect_set(struct interface *ifp, int set)
{
struct ripng_interface *ri = ifp->info;
struct ripng *ripng = ri->ripng;
- struct listnode *node, *nnode;
struct connected *connected;
struct prefix_ipv6 address;
- for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, connected)) {
+ frr_each (if_connected, ifp->connected, connected) {
struct prefix *p;
p = connected->address;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 465b40bd3..bb6ec0234 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -392,11 +392,10 @@ static void ripng_nexthop_rte(struct rte *rte, struct sockaddr_in6 *from,
/* If ifp has same link-local address then return 1. */
static int ripng_lladdr_check(struct interface *ifp, struct in6_addr *addr)
{
- struct listnode *node;
struct connected *connected;
struct prefix *p;
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected)) {
+ frr_each (if_connected, ifp->connected, connected) {
p = connected->address;
if (p->family == AF_INET6