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.
This commit is contained in:
parent
5004d02cb9
commit
2d785e8d6a
1 changed files with 2 additions and 1 deletions
|
@ -934,7 +934,8 @@ sk_open(sock *s)
|
||||||
}
|
}
|
||||||
fill_in_sockaddr(&sa, s->saddr, port);
|
fill_in_sockaddr(&sa, s->saddr, port);
|
||||||
#ifdef CONFIG_SKIP_MC_BIND
|
#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
|
#else
|
||||||
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
|
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue