diff options
| author | Anders Kaseorg <andersk@mit.edu> | 2020-01-01 11:42:47 -0800 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-01-01 22:49:29 +0000 |
| commit | 51880d726a2b15039f0b4f8a052c9b3254eb0691 (patch) | |
| tree | bc1531e7a8bd8417c0fb7a48bb42631adfa12c28 | |
| parent | 12d80730ccf95f4273306f650c1e99cb9f4095be (diff) | |
| download | dhcpcd-51880d726a2b15039f0b4f8a052c9b3254eb0691.tar.xz | |
Linux: fix RA time unit confusion
The RA times are provided in milliseconds, but commit
569051c8aa8fc297eb8edb7bd228e0fd353d30c1 (dhcpcd-8.1.3~18) “Linux:
prefer ms RA times” incorrectly scaled them by an extra factor of 1000
before writing them to retrans_time_ms and base_reachable_time_ms.
Instead, write the values in milliseconds directly to the *_ms files.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
| -rw-r--r-- | src/if-linux.c | 18 | ||||
| -rw-r--r-- | src/ipv6nd.c | 2 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/if-linux.c b/src/if-linux.c index ccfad8de..6719e487 100644 --- a/src/if-linux.c +++ b/src/if-linux.c @@ -1898,22 +1898,14 @@ if_applyra(const struct ra *rap) error = -1; 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; - } + if (if_writepathuint(path, rap->retrans) == -1) + error = -1; snprintf(path, sizeof(path), "%s/%s/base_reachable_time_ms", p_neigh, ifname); - if (if_writepathuint(path, rap->reachable * 1000) == -1) { - snprintf(path, sizeof(path), "%s/%s/base_reachable_time", - p_neigh, ifname); - if (if_writepathuint(path, rap->reachable) == -1) - error = -1; - } + if (if_writepathuint(path, rap->reachable) == -1) + error = -1; + return error; } diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 14a357f7..798f23b7 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -622,7 +622,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__); } |
