projects
/
project
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01c1163
)
router: don't announce as default router if we aren't
author
Steven Barth
<steven@midlink.org>
Mon, 7 Sep 2015 09:48:05 +0000
(11:48 +0200)
committer
Steven Barth
<steven@midlink.org>
Mon, 7 Sep 2015 09:48:05 +0000
(11:48 +0200)
src/router.c
patch
|
blob
|
history
diff --git
a/src/router.c
b/src/router.c
index
3fbf590
..
a23b530
100644
(file)
--- a/
src/router.c
+++ b/
src/router.c
@@
-293,6
+293,7
@@
static uint64_t send_router_advert(struct interface *iface, const struct in6_add
minvalid = 1000LL * TIME_LEFT(addr->valid, now);
if (((addr->addr.s6_addr[0] & 0xfe) != 0xfc || iface->default_router)
minvalid = 1000LL * TIME_LEFT(addr->valid, now);
if (((addr->addr.s6_addr[0] & 0xfe) != 0xfc || iface->default_router)
+ && adv.h.nd_ra_router_lifetime
&& ntohs(adv.h.nd_ra_router_lifetime) < TIME_LEFT(addr->valid, now))
adv.h.nd_ra_router_lifetime = htons(TIME_LEFT(addr->valid, now));
&& ntohs(adv.h.nd_ra_router_lifetime) < TIME_LEFT(addr->valid, now))
adv.h.nd_ra_router_lifetime = htons(TIME_LEFT(addr->valid, now));
@@
-315,7
+316,7
@@
static uint64_t send_router_advert(struct interface *iface, const struct in6_add
p->nd_opt_pi_valid_time = 0;
}
p->nd_opt_pi_valid_time = 0;
}
- if (!iface->default_router &&
ntohs(adv.h.nd_ra_router_lifetime) == 1
) {
+ if (!iface->default_router &&
adv.h.nd_ra_router_lifetime == htons(1)
) {
syslog(LOG_WARNING, "A default route is present but there is no public prefix "
"on %s thus we don't announce a default route!", iface->ifname);
adv.h.nd_ra_router_lifetime = 0;
syslog(LOG_WARNING, "A default route is present but there is no public prefix "
"on %s thus we don't announce a default route!", iface->ifname);
adv.h.nd_ra_router_lifetime = 0;