From: Roy Marples Date: Sun, 17 Nov 2019 19:57:27 +0000 (+0000) Subject: Linux: prefer ms RA times X-Git-Tag: v8.1.3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f0bcfdab3cd77fd5cb338d74f9da5916036d67f;p=thirdparty%2Fdhcpcd.git Linux: prefer ms RA times The old sysctls have apparently been deprecated since 2.6.12. --- diff --git a/src/if-linux.c b/src/if-linux.c index 2d0264a2..b3e0a65e 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -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; }