summaryrefslogtreecommitdiff
path: root/pimd/pim_tlv.c
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 /pimd/pim_tlv.c
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 'pimd/pim_tlv.c')
-rw-r--r--pimd/pim_tlv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c
index 80d60b8628..c463fa227c 100644
--- a/pimd/pim_tlv.c
+++ b/pimd/pim_tlv.c
@@ -217,18 +217,17 @@ int pim_encode_addr_group(uint8_t *buf, afi_t afi, int bidir, int scope,
uint8_t *pim_tlv_append_addrlist_ucast(uint8_t *buf, const uint8_t *buf_pastend,
struct interface *ifp, int family)
{
- struct listnode *node;
uint16_t option_len = 0;
uint8_t *curr;
size_t uel;
- struct list *ifconnected = ifp->connected;
+ struct connected *ifc;
struct pim_interface *pim_ifp = ifp->info;
pim_addr addr;
- node = listhead(ifconnected);
+ ifc = if_connected_first(ifp->connected);
/* Empty address list ? */
- if (!node) {
+ if (!ifc) {
return buf;
}
@@ -239,8 +238,7 @@ uint8_t *pim_tlv_append_addrlist_ucast(uint8_t *buf, const uint8_t *buf_pastend,
/* Scan secondary address list */
curr = buf + 4; /* skip T and L */
- for (; node; node = listnextnode(node)) {
- struct connected *ifc = listgetdata(node);
+ for (; ifc; ifc = if_connected_next(ifp->connected, ifc)) {
struct prefix *p = ifc->address;
int l_encode;