File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -741,6 +741,19 @@ if_route(unsigned char cmd, const struct rt *rt)
741741 !sa_is_loopback (& rt -> rt_gateway ))
742742 {
743743 rtm -> rtm_index = (unsigned short )rt -> rt_ifp -> index ;
744+ /*
745+ * OpenBSD rejects the message for on-link routes.
746+ * FreeBSD-12 kernel apparently panics.
747+ * I can't replicate the panic, but better safe than sorry!
748+ * https://roy.marples.name/archives/dhcpcd-discuss/0002286.html
749+ *
750+ * Neither OS currently allows IPv6 address sharing anyway, so let's
751+ * try to encourage someone to fix that by logging a waring during compile.
752+ */
753+ #if defined(__FreeBSD__ ) || defined(__OpenBSD__ )
754+ #warning kernel does not allow IPv6 address sharing
755+ if (!gateway_unspec || rt -> rt_dest .sa_family != AF_INET6 )
756+ #endif
744757 rtm -> rtm_addrs |= RTA_IFP ;
745758 if (!sa_is_unspecified (& rt -> rt_ifa ))
746759 rtm -> rtm_addrs |= RTA_IFA ;
You can’t perform that action at this time.
0 commit comments