From 2d785e8d6a646a878c970583aa54a15209fa0e6e Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 26 Jun 2009 13:33:41 +0200 Subject: 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. --- sysdep/unix/io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdep/unix/io.c') 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 -- cgit v1.2.3