summaryrefslogtreecommitdiffstats
path: root/support/nfs/svc_socket.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-03-22 16:06:22 +1100
committerNeil Brown <neilb@suse.de>2007-03-22 16:06:22 +1100
commitbd401e645200601ab9c25dab905425112f3cafc4 (patch)
treebc85cab6ddaebd5108b7480e946ec84a2e27c0d6 /support/nfs/svc_socket.c
parent0ec44a497a508fb631d472ce8c33041c497e1ca5 (diff)
downloadnfs-utils-bd401e645200601ab9c25dab905425112f3cafc4.tar.gz
nfs-utils-bd401e645200601ab9c25dab905425112f3cafc4.tar.xz
nfs-utils-bd401e645200601ab9c25dab905425112f3cafc4.zip
Never set SO_REUSEADDR on a UDP socket.
The effect is quite different from TCP sockets. For TCP, it allows you to listen for new connections even if there are outstanding old connections with the same local address. For UDP, it allows other people to steal your packets by binding to the same address.
Diffstat (limited to 'support/nfs/svc_socket.c')
-rw-r--r--support/nfs/svc_socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/nfs/svc_socket.c b/support/nfs/svc_socket.c
index 3307600..6799d16 100644
--- a/support/nfs/svc_socket.c
+++ b/support/nfs/svc_socket.c
@@ -162,7 +162,7 @@ svctcp_socket (u_long number, int reuse)
int
svcudp_socket (u_long number, int reuse)
{
- return svc_socket (number, SOCK_DGRAM, IPPROTO_UDP, reuse);
+ return svc_socket (number, SOCK_DGRAM, IPPROTO_UDP, 0);
}
#ifdef TEST