diff options
-rw-r--r-- | nametoaddr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nametoaddr.c b/nametoaddr.c index 087d14be..194ff45b 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -306,7 +306,8 @@ pcap_nametoport(const char *name, int *port, int *proto) hints.ai_protocol = IPPROTO_TCP; error = getaddrinfo(NULL, name, &hints, &res); if (error != 0) { - if (error != EAI_NONAME) { + if (error != EAI_NONAME && + error != EAI_SERVICE) { /* * This is a real error, not just "there's * no such service name". @@ -349,7 +350,8 @@ pcap_nametoport(const char *name, int *port, int *proto) hints.ai_protocol = IPPROTO_UDP; error = getaddrinfo(NULL, name, &hints, &res); if (error != 0) { - if (error != EAI_NONAME) { + if (error != EAI_NONAME && + error != EAI_SERVICE) { /* * This is a real error, not just "there's * no such service name". |