diff --git a/sysdep/cf/README b/sysdep/cf/README index a3442752..b278fc5a 100644 --- a/sysdep/cf/README +++ b/sysdep/cf/README @@ -8,6 +8,7 @@ CONFIG_ALL_TABLES_AT_ONCE Kernel scanner wants to process all tables at once CONFIG_UNIX_IFACE Use Unix interface scanner CONFIG_UNIX_SET Use Unix route setting +CONFIG_UNIX_DONTROUTE Use setsockopts DONTROUTE (undef for *BSD) CONFIG_LINUX_SCAN Use Linux /proc/net/route scanner CONFIG_ALL_MULTICAST krt-iface: All devices support multicasting (i.e., ignore IFF_MULTICAST) diff --git a/sysdep/cf/bsd.h b/sysdep/cf/bsd.h index cfce773e..f1475064 100644 --- a/sysdep/cf/bsd.h +++ b/sysdep/cf/bsd.h @@ -12,6 +12,7 @@ #undef CONFIG_UNIX_IFACE #undef CONFIG_UNIX_SET +#undef CONFIG_UNIX_DONTROUTE #define CONFIG_ALL_MULTICAST #define CONFIG_UNNUM_MULTICAST diff --git a/sysdep/cf/linux-20.h b/sysdep/cf/linux-20.h index 5c6a2377..247f0f1d 100644 --- a/sysdep/cf/linux-20.h +++ b/sysdep/cf/linux-20.h @@ -12,6 +12,7 @@ #define CONFIG_UNIX_IFACE #define CONFIG_UNIX_SET +#define CONFIG_UNIX_DONTROUTE #define CONFIG_LINUX_SCAN #define CONFIG_LINUX_MC_MREQ_BIND diff --git a/sysdep/cf/linux-21.h b/sysdep/cf/linux-21.h index 17882c81..57ae7962 100644 --- a/sysdep/cf/linux-21.h +++ b/sysdep/cf/linux-21.h @@ -12,6 +12,7 @@ #define CONFIG_UNIX_IFACE #define CONFIG_UNIX_SET +#define CONFIG_UNIX_DONTROUTE #define CONFIG_LINUX_SCAN #define CONFIG_LINUX_MC_MREQN diff --git a/sysdep/cf/linux-22.h b/sysdep/cf/linux-22.h index 52a4681a..f3629433 100644 --- a/sysdep/cf/linux-22.h +++ b/sysdep/cf/linux-22.h @@ -12,6 +12,7 @@ #define CONFIG_ALL_TABLES_AT_ONCE #define CONFIG_LINUX_MC_MREQN +#define CONFIG_UNIX_DONTROUTE /* Link: sysdep/linux/netlink diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index c3bd5f8c..070150f6 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -578,8 +578,10 @@ sk_setup(sock *s) WARN("IP_TOS"); if (s->ttl >= 0 && setsockopt(fd, SOL_IP, IP_TTL, &s->ttl, sizeof(s->ttl)) < 0) ERR("IP_TTL"); - //if (s->ttl == 1 && setsockopt(fd, SOL_SOCKET, SO_DONTROUTE, &one, sizeof(one)) < 0) - // ERR("SO_DONTROUTE"); +#ifdef CONFIG_UNIX_DONTROUTE + if (s->ttl == 1 && setsockopt(fd, SOL_SOCKET, SO_DONTROUTE, &one, sizeof(one)) < 0) + ERR("SO_DONTROUTE"); +#endif #endif err = NULL; bad: