summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2004-06-03 08:18:14 +0000
committerOndrej Filip <feela@network.cz>2004-06-03 08:18:14 +0000
commit7d72aadb8acfac16e9b637e6ebb5ce288ebf1d77 (patch)
treef082b3abfc6df9858a65f271d7075e6549e51ec7
parentcb4dd4e2f78f806438bfb8163b783ac7b2f43b2d (diff)
CONFIG_SKIP_MC_BIND added.
BSD hates it, Linux needs it.
-rw-r--r--sysdep/cf/README1
-rw-r--r--sysdep/cf/bsd-v6.h1
-rw-r--r--sysdep/cf/bsd.h1
-rw-r--r--sysdep/cf/linux-20.h1
-rw-r--r--sysdep/cf/linux-21.h1
-rw-r--r--sysdep/cf/linux-22.h2
-rw-r--r--sysdep/unix/io.c4
7 files changed, 11 insertions, 0 deletions
diff --git a/sysdep/cf/README b/sysdep/cf/README
index b278fc5a..b3b84a83 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 5f66e562..f3aefeb4 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 f1475064..72b24720 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 247f0f1d..e409706a 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 57ae7962..0fce7053 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 f3629433..92ffb4ca 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 070150f6..bf97e53e 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);