From: Ken Raeburn Date: Mon, 7 Apr 2003 20:55:18 +0000 (+0000) Subject: * fake-addrinfo.h (getaddrinfo) [NUMERIC_SERVICE_BROKEN]: Overwrite the port X-Git-Tag: krb5-1.4-beta1~1026 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c9dde00e5be6f83bd609b83a606c96387e0eada5;p=krb5.git * fake-addrinfo.h (getaddrinfo) [NUMERIC_SERVICE_BROKEN]: Overwrite the port number only if a numeric service port was supplied. ticket: 1392 status: open target_version: 1.3 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15324 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 954fd4344..fea9e3ee1 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2003-04-07 Ken Raeburn + + * fake-addrinfo.h (getaddrinfo) [NUMERIC_SERVICE_BROKEN]: + Overwrite the port number only if a numeric service port was + supplied. + 2003-04-01 Ken Raeburn * fake-addrinfo.h (COPY_FIRST_CANONNAME) [_AIX]: Define. diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h index 7474543fc..b019c3823 100644 --- a/src/include/fake-addrinfo.h +++ b/src/include/fake-addrinfo.h @@ -1055,17 +1055,19 @@ getaddrinfo (const char *name, const char *serv, const struct addrinfo *hint, #endif #ifdef NUMERIC_SERVICE_BROKEN - for (ai = *result; ai; ai = ai->ai_next) { - if (socket_type != 0 && ai->ai_socktype == 0) - /* Is this check actually needed? */ - ai->ai_socktype = socket_type; - switch (ai->ai_family) { - case AF_INET: - ((struct sockaddr_in *)ai->ai_addr)->sin_port = service_port; - break; - case AF_INET6: - ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = service_port; - break; + if (service_port != 0) { + for (ai = *result; ai; ai = ai->ai_next) { + if (socket_type != 0 && ai->ai_socktype == 0) + /* Is this check actually needed? */ + ai->ai_socktype = socket_type; + switch (ai->ai_family) { + case AF_INET: + ((struct sockaddr_in *)ai->ai_addr)->sin_port = service_port; + break; + case AF_INET6: + ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = service_port; + break; + } } } #endif