]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
inet6: Adjust prior so that we don't support old kernels
authorRoy Marples <roy@marples.name>
Wed, 1 Jan 2020 22:52:43 +0000 (22:52 +0000)
committerRoy Marples <roy@marples.name>
Wed, 1 Jan 2020 22:52:43 +0000 (22:52 +0000)
Mulitplying retrans could overflow on 32-bit kernels with
big timers, so just don't bother.

src/if-linux.c
src/ipv6nd.c

index fe05901ebd1422e02f2077166b3f73aa86f3a652..f67704bbc05cc6730d14915bab0d9741625597d3 100644 (file)
@@ -1948,22 +1948,14 @@ if_applyra(const struct ra *rap)
                error = -1;
 
        snprintf(path, sizeof(path), "%s/%s/retrans_time_ms", p_neigh, ifname);
-       if (if_writepathuint(ctx, path, rap->retrans) == -1) {
-               snprintf(path, sizeof(path), "%s/%s/retrans_time",
-                   p_neigh, ifname);
-               /* Jiffies */
-               if (if_writepathuint(ctx, path, rap->retrans * sysconf(_SC_CLK_TCK) / 1000) == -1)
-                       error = -1;
-       }
+       if (if_writepathuint(ctx, path, rap->retrans) == -1)
+               error = -1;
 
        snprintf(path, sizeof(path), "%s/%s/base_reachable_time_ms",
            p_neigh, ifname);
-       if (if_writepathuint(ctx, path, rap->reachable) == -1) {
-               snprintf(path, sizeof(path), "%s/%s/base_reachable_time",
-                   p_neigh, ifname);
-               if (if_writepathuint(ctx, path, rap->reachable / 1000) == -1)
-                       error = -1;
-       }
+       if (if_writepathuint(ctx, path, rap->reachable) == -1)
+               error = -1;
+
        return error;
 }
 
index c2f592b02e91fb146898cccba18ba738dd748a74..0f9b050e7d1f6dbf80831038c673ed42515a4947 100644 (file)
@@ -645,7 +645,7 @@ ipv6nd_applyra(struct dhcpcd_ctx *ctx, struct interface *ifp)
                return;
 
        state->retrans = rap->retrans;
-       if (if_applyra(rap) == -1)
+       if (if_applyra(rap) == -1 && errno != ENOENT)
                logerr(__func__);
 }