summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-11-20 18:10:13 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-11-20 18:10:13 +0000
commitc661c6381043f17ecf163ef83030751e86013d1b (patch)
tree8338f95f98d3874617298fbbffc5bb05dcc302e9 /sbin
parent7204e5c771b3e6333e20c7393a8d4bc8f76ef54f (diff)
Form DNS proposals from router advertisements with a router lifetime
of zero. It just means that the router is not a default router. This is also true for prefixes, but not yet implemented. (The diff looks complicated but it's only a } moved up + reindent.)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/slaacd/engine.c72
1 files changed, 34 insertions, 38 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c
index a8d41e0ce25..e082a80eb00 100644
--- a/sbin/slaacd/engine.c
+++ b/sbin/slaacd/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.44 2019/11/11 05:48:46 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.45 2019/11/20 18:10:12 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -1918,46 +1918,42 @@ void update_iface_ra(struct slaacd_iface *iface, struct radv *ra)
1);
}
}
+ }
#ifndef SMALL
- rdns_proposal = find_rdns_proposal_by_gw(iface, &ra->from);
- if (rdns_proposal) {
- if (real_lifetime(&rdns_proposal->uptime,
- rdns_proposal->rdns_lifetime) >
- ra->rdns_lifetime)
- log_warnx("ignoring router advertisement "
- "lowering router lifetime");
- else {
- rdns_proposal->when = ra->when;
- rdns_proposal->uptime = ra->uptime;
- rdns_proposal->rdns_lifetime =
- ra->rdns_lifetime;
-
- log_debug("%s, rdns state: %s, rl: %d",
- __func__, proposal_state_name[
- rdns_proposal->state],
- real_lifetime(&rdns_proposal->uptime,
- rdns_proposal->rdns_lifetime));
-
- switch (rdns_proposal->state) {
- case PROPOSAL_SENT:
- case PROPOSAL_NEARLY_EXPIRED:
- log_debug("updating rdns");
- propose_rdns(rdns_proposal);
- break;
- default:
- hbuf = sin6_to_str(
- &rdns_proposal->from);
- log_debug("%s: iface %d: %s",
- __func__, iface->if_index,
- hbuf);
- break;
- }
+ rdns_proposal = find_rdns_proposal_by_gw(iface, &ra->from);
+ if (rdns_proposal) {
+ if (real_lifetime(&rdns_proposal->uptime,
+ rdns_proposal->rdns_lifetime) > ra->rdns_lifetime)
+ /* XXX check RFC */
+ log_warnx("ignoring router advertisement lowering rdns "
+ "lifetime");
+ else {
+ rdns_proposal->when = ra->when;
+ rdns_proposal->uptime = ra->uptime;
+ rdns_proposal->rdns_lifetime = ra->rdns_lifetime;
+
+ log_debug("%s, rdns state: %s, rl: %d", __func__,
+ proposal_state_name[rdns_proposal->state],
+ real_lifetime(&rdns_proposal->uptime,
+ rdns_proposal->rdns_lifetime));
+
+ switch (rdns_proposal->state) {
+ case PROPOSAL_SENT:
+ case PROPOSAL_NEARLY_EXPIRED:
+ log_debug("updating rdns");
+ propose_rdns(rdns_proposal);
+ break;
+ default:
+ hbuf = sin6_to_str(&rdns_proposal->from);
+ log_debug("%s: iface %d: %s", __func__,
+ iface->if_index, hbuf);
+ break;
}
- } else
- /* new proposal */
- gen_rdns_proposal(iface, ra);
+ }
+ } else
+ /* new proposal */
+ gen_rdns_proposal(iface, ra);
#endif /* SMALL */
- }
}
void