summaryrefslogtreecommitdiff
path: root/src/network/getservbyport_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/getservbyport_r.c')
-rw-r--r--src/network/getservbyport_r.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c
index f119abc8..821afae9 100644
--- a/src/network/getservbyport_r.c
+++ b/src/network/getservbyport_r.c
@@ -15,6 +15,10 @@ int getservbyport_r(int port, const char *prots,
.sin_port = port,
};
+ if (!prots) return -(
+ getservbyport_r(port, "tcp", se, buf, buflen, res)
+ && getservbyport_r(port, "udp", se, buf, buflen, res) );
+
/* Align buffer */
i = (uintptr_t)buf & sizeof(char *)-1;
if (!i) i = sizeof(char *);