Skip to content

ipmaddr: read link-layer multicast addresses via netlink

Yuyang Huang netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2uapi: update if_addr.hinclude/uapi/linux/if_addr.h+1 -00 replies
2/2ipmaddr: read link-layer multicast addresses via netlinkip/ipmaddr.c+8 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH iproute2-next 0/2] ipmaddr: read link-layer multicast addresses via netlink

"ip maddr show" gets the IPv4 and IPv6 multicast addresses from RTM_GETMULTICAST dumps, but it still parses /proc/net/dev_mcast for the link-layer addresses. The kernel now also supports RTM_GETMULTICAST dumps with ifa_family AF_PACKET, which report the device multicast list with every column of /proc/net/dev_mcast. Patch 2 uses this dump. The output does not change. Older kernels reject the AF_PACKET dump with EOPNOTSUPP, and "ip maddr" then reads /proc/net/dev_mcast as before.

Patch 1 adds IFA_F_GLOBAL to include/uapi/linux/if_addr.h. It is only there so that the series builds, and it should not be merged: the uapi headers are synced into iproute2-next regularly, and the next sync brings in IFA_F_GLOBAL.

The kernel side is the net-next series "rtnetlink: dump link-layer multicast addresses":
https://patch.msgid.link/[email protected]

Testing:
- net-next kernel in vng: "ip maddr show" output is byte-identical to the current code for plain, -0/-4/-6, -o, -j, dev and -n <netns>, and /proc/net/dev_mcast is not read. This includes a multi-part dump with 2000 entries on one device.
- 7.1 kernel without AF_PACKET support: falls back to /proc/net/dev_mcast, with the same output.

Yuyang Huang (2):
uapi: update if_addr.h
ipmaddr: read link-layer multicast addresses via netlink

 include/uapi/linux/if_addr.h |  1 +
 ip/ipmaddr.c                 | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.56.0.455.g6c5a503b38-goog