summaryrefslogtreecommitdiff
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-06-26 13:33:41 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-06-26 13:33:41 +0200
commit2d785e8d6a646a878c970583aa54a15209fa0e6e (patch)
treee2ef9f0ba5ed45c8543ac09dda3e6cd0b6262b3f /sysdep/unix/io.c
parent5004d02cb9df1f3ee231632a8e89929f4eb4f088 (diff)
Fixes bug on TCP passive socket binding on BSD.
BGP on BSD was bound to random port. I am surprised that nobody noticed it already.
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index c86c1200..a5e05222 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -934,7 +934,8 @@ sk_open(sock *s)
}
fill_in_sockaddr(&sa, s->saddr, port);
#ifdef CONFIG_SKIP_MC_BIND
- if (type == SK_IP && bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
+ if ((type != SK_UDP_MC) && (type != SK_IP_MC) &&
+ bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
#else
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
#endif