RE: [PATCH net-next v11 6/6] selftests: net: test AF_PACKET multicast dumps
From: Loktionov, Aleksandr
Date: Wed Oct 14 2026 - 06:46:39 EST
> -----Original Message-----
> From: Yuyang Huang <uyoko90@xxxxxxxxx> On Behalf Of Yuyang Huang
> Sent: Monday, October 12, 2026 3:17 AM
> To: Yuyang Huang <sigefriedhyy@xxxxxxxxx>
> Cc: Ajay Singh <ajay.kathat@xxxxxxxxxxxxx>; Loktionov, Aleksandr
> <aleksandr.loktionov@xxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> Claudiu Beznea <claudiu.beznea@xxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; David Ahern <dsahern@xxxxxxxxxx>; Donald Hunter
> <donald.hunter@xxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Ido
> Schimmel <idosch@xxxxxxxxxx>; Keller, Jacob E
> <jacob.e.keller@xxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Johannes
> Berg <johannes@xxxxxxxxxxxxxxxx>; Kees Cook <kees@xxxxxxxxxx>; Kory
> Maincent <kory.maincent@xxxxxxxxxxx>; Kuniyuki Iwashima
> <kuniyu@xxxxxxxxxx>; Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>;
> Nikolaos Gkarlis <nickgarlis@xxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>; Shuah Khan
> <shuah@xxxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Stanislav Fomichev
> <sdf.kernel@xxxxxxxxx>; Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>;
> Willem de Bruijn <willemb@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx;
> linux-kselftest@xxxxxxxxxxxxxxx; linux-wireless@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx
> Subject: [PATCH net-next v11 6/6] selftests: net: test AF_PACKET
> multicast dumps
>
> Dump the link-layer multicast addresses of a dummy device and verify
> that ifa_index restricts the dump to that device, that the all-hosts
> address joined on link up is listed without IFA_F_GLOBAL, that an
> address added with SIOCADDMULTI is listed with IFA_F_GLOBAL and
> IFA_MC_USERS, and that IFA_TARGET_NETNSID dumps another netns.
>
> Signed-off-by: Yuyang Huang <sigefriedhyy@xxxxxxxxx>
> Reviewed-by: Nicolas Dichtel <nicolas.dichtel@xxxxxxxxx>
> ---
> tools/testing/selftests/net/rtnetlink.py | 73 +++++++++++++++++++++++-
> 1 file changed, 71 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/rtnetlink.py
> b/tools/testing/selftests/net/rtnetlink.py
> index dc8c77db48974..5534ade056a5c 100755
> --- a/tools/testing/selftests/net/rtnetlink.py
> +++ b/tools/testing/selftests/net/rtnetlink.py
> @@ -5,13 +5,18 @@ import socket
> import struct
> import time
> from lib.py import bkg, ip, ksft_exit, ksft_run, ksft_eq, ksft_ge,
> ksft_true, KsftSkipEx -from lib.py import ksft_not_in, ksft_not_none
> +from lib.py import ksft_in, ksft_not_in, ksft_not_none
> from lib.py import CmdExitFailure, NetNS, NetNSEnter, RtnlAddrFamily,
> RtnlRouteFamily from lib.py import defer
>
> IPV4_ALL_HOSTS_MULTICAST = b'\xe0\x00\x00\x01'
> IPV4_TEST_MULTICAST = b'\xef\x01\x01\x01'
> IPV6_TEST_MULTICAST = bytes.fromhex('ff020000000000000000000000000123')
> +ETH_ALL_HOSTS_MULTICAST = bytes.fromhex('01005e000001')
> +ETH_TEST_MULTICAST_STR = '01:00:5e:01:01:01'
> +ETH_TEST_MULTICAST = bytes.fromhex(ETH_TEST_MULTICAST_STR.replace(':',
> +'')) ETH_PEER_MULTICAST_STR = '01:00:5e:02:02:02'
> +ETH_PEER_MULTICAST = bytes.fromhex(ETH_PEER_MULTICAST_STR.replace(':',
> +''))
>
>
> def _users_for(rtnl: RtnlAddrFamily, family: int, grp: bytes, ifindex:
> int):
> @@ -105,6 +110,69 @@ def dump_mcaddr6_check() -> None:
> s2.close()
>
>
...
> ipv6_route_del_reason_expired,
> ipv6_route_del_reason_ra_withdrawn,
> ipv6_route_del_reason_absent,
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>