diff options
| author | Roy Marples <roy@marples.name> | 2012-11-07 00:49:33 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2012-11-07 00:49:33 +0000 |
| commit | b88df4213551e71d7e60e765d4d467fb3c3dc74f (patch) | |
| tree | d47f668dacd5f00faff424540ba81161dff3e87c /ipv6rs.c | |
| parent | e54dee19baa8add8723bdff6b52f7330e40c6c8b (diff) | |
| download | dhcpcd-b88df4213551e71d7e60e765d4d467fb3c3dc74f.tar.xz | |
When an RA is forced to expire, don't run the script twice.
Diffstat (limited to 'ipv6rs.c')
| -rw-r--r-- | ipv6rs.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -520,7 +520,8 @@ ipv6rs_handledata(_unused void *arg) } if (nd_ra->nd_ra_retransmit) rap->retrans = ntohl(nd_ra->nd_ra_retransmit); - rap->expired = (rap->lifetime == 0); + if (rap->lifetime) + rap->expired = 0; len -= sizeof(struct nd_router_advert); p = ((uint8_t *)icp) + sizeof(struct nd_router_advert); @@ -731,11 +732,14 @@ ipv6rs_handledata(_unused void *arg) add_router(rap); if (options & DHCPCD_IPV6RA_OWN && !(options & DHCPCD_TEST)) ipv6_addaddrs(ifp, &rap->addrs); - if (!(options & DHCPCD_TEST)) - ipv6_buildroutes(); - run_script_reason(ifp, options & DHCPCD_TEST ? "TEST" : "ROUTERADVERT"); - if (options & DHCPCD_TEST) + if (options & DHCPCD_TEST) { + run_script_reason(ifp, "TEST"); goto handle_flag; + } + ipv6_buildroutes(); + /* We will get run by the expire function */ + if (rap->lifetime) + run_script_reason(ifp, "ROUTERADVERT"); /* If we don't require RDNSS then set has_dns = 1 so we fork */ if (!(ifp->state->options->options & DHCPCD_IPV6RA_REQRDNSS)) |
