krb5 commit: Fix net-server.c when AI_NUMERICSERV is undefined

[email protected]
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/f8ecc0ae74c7ebd84f042e28079aa6b4b2ae405c
commit f8ecc0ae74c7ebd84f042e28079aa6b4b2ae405c
Author: Sergey Fedorov <[email protected]>
Date:   Fri May 27 01:06:38 2022 +0800

    Fix net-server.c when AI_NUMERICSERV is undefined
    
    Some macOS versions do not define AI_NUMERICSERV.  Other source files
    check whether it is defined before using it; do so here as well.
    
    [[email protected]: rewrote commit message; slightly changed approach]
    
    ticket: 9062 (new)
    tags: pullup
    target_version: 1.20-next

 src/lib/apputils/net-server.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/apputils/net-server.c b/src/lib/apputils/net-server.c
index 294dcfc89..1bdc7932b 100644
--- a/src/lib/apputils/net-server.c
+++ b/src/lib/apputils/net-server.c
@@ -828,7 +828,10 @@ setup_addresses(verto_ctx *ctx, void *handle, const char *prog,
      * resolution. */
     memset(&hints, 0, sizeof(struct addrinfo));
     hints.ai_family = AF_UNSPEC;
-    hints.ai_flags = AI_PASSIVE | AI_NUMERICSERV;
+    hints.ai_flags = AI_PASSIVE;
+#ifdef AI_NUMERICSERV
+    hints.ai_flags |= AI_NUMERICSERV;
+#endif
 
     /* Add all the requested addresses. */
     for (i = 0; i < bind_addresses.n; i++) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.