-/* $OpenBSD: engine.c,v 1.24 2017/05/28 20:40:13 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.25 2017/05/29 07:54:46 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
LIST_INIT(&iface->addr_proposals);
LIST_INIT(&iface->dfr_proposals);
} else {
+ int need_refresh = 0;
DEBUG_IMSG("%s: updating %d", __func__,
imsg_ifinfo.if_index);
+
+ if (iface->autoconfprivacy !=
+ imsg_ifinfo.autoconfprivacy) {
+ iface->autoconfprivacy =
+ imsg_ifinfo.autoconfprivacy;
+ need_refresh = 1;
+ }
+ if (memcmp(&iface->hw_address,
+ &imsg_ifinfo.hw_address,
+ sizeof(struct ether_addr)) != 0) {
+ memcpy(&iface->hw_address,
+ &imsg_ifinfo.hw_address,
+ sizeof(struct ether_addr));
+ need_refresh = 1;
+ }
+
if (!iface->state == IF_DOWN &&
- imsg_ifinfo.running)
+ imsg_ifinfo.running && need_refresh)
start_probe(iface);
+
iface->running = imsg_ifinfo.running;
if (!iface->running) {
iface->state = IF_DOWN;
NULL))
evtimer_del(&iface->timer);
}
- iface->autoconfprivacy =
- imsg_ifinfo.autoconfprivacy;
- memcpy(&iface->hw_address,
- &imsg_ifinfo.hw_address,
- sizeof(struct ether_addr));
+
memcpy(&iface->ll_address,
&imsg_ifinfo.ll_address,
sizeof(struct sockaddr_in6));
-/* $OpenBSD: frontend.c,v 1.11 2017/05/28 09:35:56 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.12 2017/05/29 07:54:46 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
}
break;
case RTM_NEWADDR:
- /*
- * XXX we get a RTM_NEWADDR if the l2 addr changes, also
- * when we configure an ip ourselfs or someone
- * configures an ip, don't send solicitations in that
- * case
- */
ifm = (struct if_msghdr *)rtm;
if_name = if_indextoname(ifm->ifm_index, ifnamebuf);
log_debug("RTM_NEWADDR: %s[%u]", if_name, ifm->ifm_index);