From 6d4b19d6a2d01e645f9fdb989eb3049b375af8a7 Mon Sep 17 00:00:00 2001 From: philomathic_life <15947783+zacknewman@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:30:03 +0000 Subject: [PATCH] revert e3c5de1 (#425) --- src/if-bsd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/if-bsd.c b/src/if-bsd.c index 7c3e5e10..68303e82 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -741,6 +741,19 @@ if_route(unsigned char cmd, const struct rt *rt) !sa_is_loopback(&rt->rt_gateway)) { rtm->rtm_index = (unsigned short)rt->rt_ifp->index; +/* + * OpenBSD rejects the message for on-link routes. + * FreeBSD-12 kernel apparently panics. + * I can't replicate the panic, but better safe than sorry! + * https://roy.marples.name/archives/dhcpcd-discuss/0002286.html + * + * Neither OS currently allows IPv6 address sharing anyway, so let's + * try to encourage someone to fix that by logging a waring during compile. + */ +#if defined(__FreeBSD__) || defined(__OpenBSD__) +#warning kernel does not allow IPv6 address sharing + if (!gateway_unspec || rt->rt_dest.sa_family!=AF_INET6) +#endif rtm->rtm_addrs |= RTA_IFP; if (!sa_is_unspecified(&rt->rt_ifa)) rtm->rtm_addrs |= RTA_IFA;