]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip ntable: Add support for "mcast_reprobes" parameter
authorIdo Schimmel <idosch@nvidia.com>
Thu, 8 May 2025 11:13:01 +0000 (14:13 +0300)
committerDavid Ahern <dsahern@kernel.org>
Tue, 13 May 2025 16:58:55 +0000 (16:58 +0000)
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 <idosch@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ipntable.c
man/man8/ip-ntable.8

index 4ce02a315fe11acb60e8c41566ebd93dc8c00081..54db9b62c837dba555f673902cb84598f31eaf01 100644 (file)
@@ -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]) {
index 4f0f2e548a21e3f1776a95f2f4bff651df868cd0..56108afe658664b7fd289f5b1e0ea76a1eb96779 100644 (file)
@@ -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