summaryrefslogtreecommitdiff
path: root/babeld
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 /babeld
parentaf22ff0bd5c5340ca377a7c727057465e7e16bb9 (diff)
*: 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 'babeld')
-rw-r--r--babeld/babel_interface.c3
-rw-r--r--babeld/babel_interface.h1
2 files changed, 1 insertions, 3 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 854c73acc6..c4349b509e 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -739,12 +739,11 @@ int
is_interface_ll_address(struct interface *ifp, const unsigned char *address)
{
struct connected *connected;
- struct listnode *node;
if(!if_up(ifp))
return 0;
- FOR_ALL_INTERFACES_ADDRESSES(ifp, connected, node) {
+ frr_each (if_connected, ifp->connected, connected) {
if (connected->address->family == AF_INET6
&& memcmp(&connected->address->u.prefix6, address,
IPV6_MAX_BYTELEN)
diff --git a/babeld/babel_interface.h b/babeld/babel_interface.h
index 12fa6e2bad..a585e23afc 100644
--- a/babeld/babel_interface.h
+++ b/babeld/babel_interface.h
@@ -82,7 +82,6 @@ static inline int
if_up(struct interface *ifp)
{
return (if_is_operative(ifp) &&
- ifp->connected != NULL &&
CHECK_FLAG(babel_get_if_nfo(ifp)->flags, BABEL_IF_IS_UP));
}