Skip to content

Commit 3c6955e

Browse files
rjarrychristophefontaine
authored andcommitted
ip6: fix leaking mcast addresses on delete
Fix leak in mcast6_addr_del. Make sure to always remove the address from the array. Signed-off-by: Robin Jarry <[email protected]>
1 parent 7361486 commit 3c6955e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

modules/ip6/control/address.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ static int mcast6_addr_del(const struct iface *iface, const struct rte_ipv6_addr
144144
if (nh == NULL)
145145
return errno_set(ENOENT);
146146

147+
// shift remaining addresses
148+
gr_vec_del(maddrs->nh, i);
149+
147150
if (nh->ref_count == 1) {
148151
LOG(INFO, "%s: leaving multicast group " IP6_F, iface->name, ip);
149-
// shift remaining addresses
150-
gr_vec_del(maddrs->nh, i);
151152
// remove ethernet filter
152153
ret = iface_del_eth_addr(iface->id, &nh->mac);
153154
}

0 commit comments

Comments
 (0)