diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-07-28 16:54:06 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2018-07-28 19:30:56 +0200 |
commit | 6be71641ef3baa8658d031f3624f4481b493bdaf (patch) | |
tree | 4d2064ba61b1460bad4aa47a820e99ced14976b9 /sysdep/bsd | |
parent | 3140c8b2ca48263da1a1f12b478031dc4b572db7 (diff) |
BSD: Use MSG_DONTROUTE for unicast packets on FreeBSD
BSD systems cannot use SO_DONTROUTE, because it does not work properly
with multicast packets (perhaps it tries to find iface based on multicast
group address). But we can use MSG_DONTROUTE sendmsg() flag for unicast
packets. Works on FreeBSD, is ignored on OpenBSD and is broken on NetBSD
(i guess due to integrated routing table and ARP table).
Diffstat (limited to 'sysdep/bsd')
-rw-r--r-- | sysdep/bsd/sysio.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdep/bsd/sysio.h b/sysdep/bsd/sysio.h index 9b10e6e8..545276a3 100644 --- a/sysdep/bsd/sysio.h +++ b/sysdep/bsd/sysio.h @@ -12,6 +12,11 @@ #include <sys/param.h> +#ifdef __FreeBSD__ +/* Should be defined in sysdep/cf/bsd.h, but it is flavor-specific */ +#define CONFIG_DONTROUTE_UNICAST +#endif + #ifdef __NetBSD__ #ifndef IP_RECVTTL |