From 7d72aadb8acfac16e9b637e6ebb5ce288ebf1d77 Mon Sep 17 00:00:00 2001 From: Ondrej Filip Date: Thu, 3 Jun 2004 08:18:14 +0000 Subject: CONFIG_SKIP_MC_BIND added. BSD hates it, Linux needs it. --- sysdep/cf/README | 1 + sysdep/cf/bsd-v6.h | 1 + sysdep/cf/bsd.h | 1 + sysdep/cf/linux-20.h | 1 + sysdep/cf/linux-21.h | 1 + sysdep/cf/linux-22.h | 2 ++ sysdep/unix/io.c | 4 ++++ 7 files changed, 11 insertions(+) diff --git a/sysdep/cf/README b/sysdep/cf/README index b278fc5..b3b84a8 100644 --- a/sysdep/cf/README +++ b/sysdep/cf/README @@ -9,6 +9,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_SKIP_MC_BIND Don't call bird on multicast socket (def 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-v6.h b/sysdep/cf/bsd-v6.h index 5f66e56..f3aefeb 100644 --- a/sysdep/cf/bsd-v6.h +++ b/sysdep/cf/bsd-v6.h @@ -15,6 +15,7 @@ #undef CONFIG_UNIX_IFACE #undef CONFIG_UNIX_SET +#define CONFIG_SKIP_MC_BIND #define CONFIG_ALL_MULTICAST #define CONFIG_UNNUM_MULTICAST diff --git a/sysdep/cf/bsd.h b/sysdep/cf/bsd.h index f147506..72b2472 100644 --- a/sysdep/cf/bsd.h +++ b/sysdep/cf/bsd.h @@ -14,6 +14,7 @@ #undef CONFIG_UNIX_SET #undef CONFIG_UNIX_DONTROUTE +#define CONFIG_SKIP_MC_BIND #define CONFIG_ALL_MULTICAST #define CONFIG_UNNUM_MULTICAST diff --git a/sysdep/cf/linux-20.h b/sysdep/cf/linux-20.h index 247f0f1..e409706 100644 --- a/sysdep/cf/linux-20.h +++ b/sysdep/cf/linux-20.h @@ -13,6 +13,7 @@ #define CONFIG_UNIX_IFACE #define CONFIG_UNIX_SET #define CONFIG_UNIX_DONTROUTE +#undef CONFIG_SKIP_MC_BIND #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 57ae796..0fce705 100644 --- a/sysdep/cf/linux-21.h +++ b/sysdep/cf/linux-21.h @@ -13,6 +13,7 @@ #define CONFIG_UNIX_IFACE #define CONFIG_UNIX_SET #define CONFIG_UNIX_DONTROUTE +#undef CONFIG_SKIP_MC_BIND #define CONFIG_LINUX_SCAN #define CONFIG_LINUX_MC_MREQN diff --git a/sysdep/cf/linux-22.h b/sysdep/cf/linux-22.h index f362943..92ffb4c 100644 --- a/sysdep/cf/linux-22.h +++ b/sysdep/cf/linux-22.h @@ -11,6 +11,8 @@ #define CONFIG_MULTIPLE_TABLES #define CONFIG_ALL_TABLES_AT_ONCE +#undef CONFIG_SKIP_MC_BIND + #define CONFIG_LINUX_MC_MREQN #define CONFIG_UNIX_DONTROUTE diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 070150f..bf97e53 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -754,7 +754,11 @@ sk_open(sock *s) ERR("SO_REUSEADDR"); } fill_in_sockaddr(&sa, s->saddr, port); +#ifdef CONFIG_SKIP_MC_BIND + if (type == SK_IP && bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) +#else if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) +#endif ERR("bind"); } fill_in_sockaddr(&sa, s->daddr, s->dport); -- cgit v1.2.3