git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
um
/
drivers
/
port_user.c
diff --git
a/arch/um/drivers/port_user.c
b/arch/um/drivers/port_user.c
index
1e8592e
..
996e817
100644
(file)
--- a/
arch/um/drivers/port_user.c
+++ b/
arch/um/drivers/port_user.c
@@
-123,12
+123,18
@@
struct chan_ops port_ops = {
int port_listen_fd(int port)
{
struct sockaddr_in addr;
int port_listen_fd(int port)
{
struct sockaddr_in addr;
- int fd, err;
+ int fd, err
, arg
;
fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1)
return(-errno);
fd = socket(PF_INET, SOCK_STREAM, 0);
if(fd == -1)
return(-errno);
+ arg = 1;
+ if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &arg, sizeof(arg)) < 0){
+ err = -errno;
+ goto out;
+ }
+
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_ANY);