]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: prefer ms RA times
authorRoy Marples <roy@marples.name>
Sun, 17 Nov 2019 19:57:27 +0000 (19:57 +0000)
committerRoy Marples <roy@marples.name>
Sun, 17 Nov 2019 19:58:27 +0000 (19:58 +0000)
The old sysctls have apparently been deprecated since 2.6.12.

src/if-linux.c

index 2d0264a2095ccd00a3f369aafb209d5f2e346f33..b3e0a65edae61f6fa163f3a8e4f660c8d62331b4 100644 (file)
@@ -1904,13 +1904,25 @@ if_applyra(const struct ra *rap)
        snprintf(path, sizeof(path), "%s/%s/hop_limit", p_conf, ifname);
        if (if_writepathuint(path, rap->hoplimit) == -1)
                error = -1;
-       snprintf(path, sizeof(path), "%s/%s/retrans_time", p_neigh, ifname);
-       if (if_writepathuint(path, rap->retrans) == -1)
-               error = -1;
-       snprintf(path, sizeof(path), "%s/%s/base_reachable_time",
+
+       snprintf(path, sizeof(path), "%s/%s/retrans_time_ms", p_neigh, ifname);
+       if (if_writepathuint(path, rap->retrans * 1000) == -1) {
+               snprintf(path, sizeof(path), "%s/%s/retrans_time",
+                   p_neigh, ifname);
+               /* Jiffies */
+               if (if_writepathuint(path, rap->retrans * 100) == -1)
+                       error = -1;
+       }
+
+       snprintf(path, sizeof(path), "%s/%s/base_reachable_time_ms",
            p_neigh, ifname);
-       if (if_writepathuint(path, rap->reachable) == -1)
-               error = -1;
+       if (if_writepathuint(path, rap->reachable * 1000) == -1) {
+               logerr("XX");
+               snprintf(path, sizeof(path), "%s/%s/base_reachable_time",
+                   p_neigh, ifname);
+               if (if_writepathuint(path, rap->reachable) == -1)
+                       error = -1;
+       }
        return error;
 }