Module Name: src
Committed By: christos
Date: Thu May 29 12:35:45 UTC 2014
Modified Files:
src/lib/libc/rpc: svc_generic.c
Log Message:
Don't try to listen on UDP sockets.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/rpc/svc_generic.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/rpc/svc_generic.c
diff -u src/lib/libc/rpc/svc_generic.c:1.16 src/lib/libc/rpc/svc_generic.c:1.17
--- src/lib/libc/rpc/svc_generic.c:1.16 Wed May 28 10:49:28 2014
+++ src/lib/libc/rpc/svc_generic.c Thu May 29 08:35:45 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: svc_generic.c,v 1.16 2014/05/28 14:49:28 christos Exp $ */
+/* $NetBSD: svc_generic.c,v 1.17 2014/05/29 12:35:45 christos Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)svc_generic.c 1.21 89/02/28 Copyr 1988 Sun Micro";
#else
-__RCSID("$NetBSD: svc_generic.c,v 1.16 2014/05/28 14:49:28 christos Exp $");
+__RCSID("$NetBSD: svc_generic.c,v 1.17 2014/05/29 12:35:45 christos Exp $");
#endif
#endif
@@ -251,7 +251,8 @@ svc_tli_create(
goto freedata;
}
}
- if (listen(fd, SOMAXCONN) == -1) {
+ if (si.si_socktype != SOCK_DGRAM &&
+ listen(fd, SOMAXCONN) == -1) {
warnx("%s: could not listen at anonymous port",
__func__);
goto freedata;
@@ -264,7 +265,8 @@ svc_tli_create(
__func__);
goto freedata;
}
- if (listen(fd, (int)bindaddr->qlen) == -1) {
+ if (si.si_socktype != SOCK_DGRAM &&
+ listen(fd, (int)bindaddr->qlen) == -1) {
warnx("%s: could not listen at requested "
"address", __func__);
goto freedata;