From: Ido Schimmel Date: Thu, 8 May 2025 11:13:01 +0000 (+0300) Subject: ip ntable: Add support for "mcast_reprobes" parameter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f98940cce003d197e7663c9a90b401bde904dcbd;p=thirdparty%2Fiproute2.git ip ntable: Add support for "mcast_reprobes" parameter Kernel commit 8da86466b837 ("net: neighbour: Add mcast_resolicit to configure the number of multicast resolicitations in PROBE state.") added the "NDTPA_MCAST_REPROBES" netlink attribute that allows user space to set / get the number of multicast probes that are sent by the kernel in PROBE state after unicast probes did not solicit a response. Add support for this parameter in iproute2. Example usage and output: $ ip ntable show dev dummy0 name arp_cache inet arp_cache dev dummy0 refcnt 1 reachable 43430 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 mcast_reprobes 0 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 1000 # ip ntable change name arp_cache dev dummy0 mcast_reprobes 5 $ ip ntable show dev dummy0 name arp_cache inet arp_cache dev dummy0 refcnt 1 reachable 43430 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 mcast_reprobes 5 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 1000 $ ip -j -p ntable show dev dummy0 name arp_cache [ { "family": "inet", "name": "arp_cache", "dev": "dummy0", "refcnt": 1, "reachable": 43430, "base_reachable": 30000, "retrans": 1000, "gc_stale": 60000, "delay_probe": 5000, "queue": 101, "app_probes": 0, "ucast_probes": 3, "mcast_probes": 3, "mcast_reprobes": 5, "anycast_delay": 1000, "proxy_delay": 800, "proxy_queue": 64, "locktime": 1000 } ] Signed-off-by: Ido Schimmel Signed-off-by: David Ahern --- diff --git a/ip/ipntable.c b/ip/ipntable.c index 4ce02a31..54db9b62 100644 --- a/ip/ipntable.c +++ b/ip/ipntable.c @@ -40,7 +40,8 @@ static void usage(void) "PARMS := [ base_reachable MSEC ] [ retrans MSEC ] [ gc_stale MSEC ]\n" " [ delay_probe MSEC ] [ queue LEN ]\n" " [ app_probes VAL ] [ ucast_probes VAL ] [ mcast_probes VAL ]\n" - " [ anycast_delay MSEC ] [ proxy_delay MSEC ] [ proxy_queue LEN ]\n" + " [ mcast_reprobes VAL ] [ anycast_delay MSEC ]\n" + " [ proxy_delay MSEC ] [ proxy_queue LEN ]\n" " [ locktime MSEC ]\n" ); @@ -223,6 +224,17 @@ static int ipntable_modify(int cmd, int flags, int argc, char **argv) rta_addattr32(parms_rta, sizeof(parms_buf), NDTPA_MCAST_PROBES, mprobe); parms_change = 1; + } else if (strcmp(*argv, "mcast_reprobes") == 0) { + __u32 mreprobe; + + NEXT_ARG(); + + if (get_u32(&mreprobe, *argv, 0)) + invarg("\"mcast_reprobes\" value is invalid", *argv); + + rta_addattr32(parms_rta, sizeof(parms_buf), + NDTPA_MCAST_REPROBES, mreprobe); + parms_change = 1; } else if (strcmp(*argv, "anycast_delay") == 0) { __u64 anycast_delay; @@ -440,6 +452,13 @@ static void print_ndtparams(struct rtattr *tpb[]) "mcast_probes %u ", mprobe); } + if (tpb[NDTPA_MCAST_REPROBES]) { + __u32 mreprobe = rta_getattr_u32(tpb[NDTPA_MCAST_REPROBES]); + + print_uint(PRINT_ANY, "mcast_reprobes", + "mcast_reprobes %u ", mreprobe); + } + print_string(PRINT_FP, NULL, "%s ", _SL_); if (tpb[NDTPA_ANYCAST_DELAY]) { diff --git a/man/man8/ip-ntable.8 b/man/man8/ip-ntable.8 index 4f0f2e54..56108afe 100644 --- a/man/man8/ip-ntable.8 +++ b/man/man8/ip-ntable.8 @@ -42,6 +42,8 @@ ip-ntable - neighbour table configuration .IR VAL " ] [" .B mcast_probes .IR VAL " ] [" +.B mcast_reprobes +.IR VAL " ] [" .B anycast_delay .IR MSEC " ] [" .B proxy_delay