Skip to content

Commit 6d4b19d

Browse files
authored
revert e3c5de1 (#425)
1 parent 7745034 commit 6d4b19d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/if-bsd.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)