Skip to content

Commit

Permalink
BSD: FreeBSD allows RTA_IFP correctly.
Browse files Browse the repository at this point in the history
Not that it allows the same IPv6 address on different interfaces
on the same network still, but that's a FreeBSD issue to fix later.

The last for #407
  • Loading branch information
rsmarples committed Jan 15, 2025
1 parent 5905fbd commit 1481407
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/if-bsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,14 +743,11 @@ if_route(unsigned char cmd, const struct rt *rt)
rtm->rtm_index = (unsigned short)rt->rt_ifp->index;
/*
* OpenBSD rejects this for on-link routes when there is no default route
* FreeBSD-12 kernel apparently panics.
* I can't replicate the panic, but better safe than sorry!
*
* Neither OS currently allows the same IPv6 address on different
* OpenBSD does not allow the same IPv6 address on different
* interfaces on the same network, so let's try to encourage someone to
* fix that by logging a waring during compile.
*/
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#ifdef __OpenBSD__
#warning kernel does not allow IPv6 address sharing
if (!gateway_unspec || rt->rt_dest.sa_family!=AF_INET6)
#endif
Expand Down

0 comments on commit 1481407

Please sign in to comment.