diff options
| author | Roy Marples <roy@marples.name> | 2018-05-02 22:01:18 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2018-05-02 22:01:18 +0100 |
| commit | f9d6e7e103e650c8423a295f6743fd9568a3c668 (patch) | |
| tree | 1e35a5ad3cfc66c8012d21e8eb4843562c2a75f6 /src/ipv6nd.c | |
| parent | c39b25fa48b449e435af3ad4f507615ab6cd5e67 (diff) | |
| download | dhcpcd-f9d6e7e103e650c8423a295f6743fd9568a3c668.tar.xz | |
ipv6nd: warn if router lifetime is set to zero
Diffstat (limited to 'src/ipv6nd.c')
| -rw-r--r-- | src/ipv6nd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c index 36a945d8..6b6fac94 100644 --- a/src/ipv6nd.c +++ b/src/ipv6nd.c @@ -750,6 +750,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp, struct ipv6_addr *ap; struct dhcp_opt *dho; uint8_t new_rap, new_data; + uint32_t old_lifetime; __printflike(1, 2) void (*logfunc)(const char *, ...); #ifdef IPV6_MANAGETEMPADDR uint8_t new_ap; @@ -858,7 +859,11 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp, clock_gettime(CLOCK_MONOTONIC, &rap->acquired); rap->flags = nd_ra->nd_ra_flags_reserved; + old_lifetime = rap->lifetime; rap->lifetime = ntohs(nd_ra->nd_ra_router_lifetime); + if (!new_rap && rap->lifetime == 0 && old_lifetime != 0) + logwarnx("%s: %s: no longer a default router", + ifp->name, rap->sfrom); if (nd_ra->nd_ra_reachable) { rap->reachable = ntohl(nd_ra->nd_ra_reachable); if (rap->reachable > MAX_REACHABLE_TIME) |
