NetBSD Problem Report #10396

Received: (qmail 7549 invoked from network); 19 Jun 2000 21:03:09 -0000
Message-Id: <200006192047.e5JKlnB03683@rumolt.teuto.de>
Date: Mon, 19 Jun 2000 22:47:49 +0200 (MEST)
From: Martin Husemann <martin@rumolt.teuto.de>
Reply-To: martin@rumolt.teuto.de
To: gnats-bugs@gnats.netbsd.org
Subject: rsync pkg does not build on IPv4 only kernel
X-Send-Pr-Version: 3.95

>Number:         10396
>Category:       pkg
>Synopsis:       rsync pkg does not build on IPv4 only kernel
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 19 21:04:00 +0000 2000
>Closed-Date:    Wed Jul 05 19:21:05 +0000 2000
>Last-Modified:  Wed Jul 05 19:21:05 +0000 2000
>Originator:     Martin Husemann
>Release:        current cvs updated on June 16, 2000
>Organization:

>Environment:

System: NetBSD rumolt.teuto.de 1.4ZD NetBSD 1.4ZD (RUMOLT) #0: Fri Jun 16 07:05:23 MEST 2000 martin@rumolt.teuto.de:/usr/src/sys-i4b/arch/i386/compile/RUMOLT i386


>Description:

When trying to build pkgsrc/net/rsync on a machine with IPv4 only kernel,
the autoconfiguration fails, since it supposes a bug in getaddrinfo.

>How-To-Repeat:

s.a.: it tries to compile this testprogram (debug output inserted by me), and
fails at inet6 = 0, inet 4 = 2, because the loop for inet6 never has been
done.

/* #include "confdefs.h" */

#include <stdio.h>
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>

main()
{
  int passive, gaierr, inet4 = 0, inet6 = 0;
  struct addrinfo hints, *ai, *aitop;
  char straddr[INET6_ADDRSTRLEN], strport[16];

  for (passive = 0; passive <= 1; passive++) {
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;
    hints.ai_flags = passive ? AI_PASSIVE : 0;
    hints.ai_socktype = SOCK_STREAM;
    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
      (void)gai_strerror(gaierr);
      fprintf(stderr, "getaddrinf() != 0\n");
      goto bad;
    }
    for (ai = aitop; ai; ai = ai->ai_next) {
      if (ai->ai_addr == NULL ||
          ai->ai_addrlen == 0 ||
          getnameinfo(ai->ai_addr, ai->ai_addrlen,
                      straddr, sizeof(straddr), strport, sizeof(strport),
                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
        fprintf(stderr, "getnameinfo != 0\n");
        goto bad;
      }
      if (strcmp(strport, "54321") != 0) {
      	fprintf(stderr, "strport != 0\n");
        goto bad;
      }
      switch (ai->ai_family) {
      case AF_INET:
        if (passive) {
          if (strcmp(straddr, "0.0.0.0") != 0) {
            fprintf(stderr, "0.0.0.0 != 0\n");
            goto bad;
          }
        } else {
          if (strcmp(straddr, "127.0.0.1") != 0) {
            fprintf(stderr, "loopback != 0\n");
            goto bad;
          }
        }
        inet4++;
        break;
      case AF_INET6:
        if (passive) {
          if (strcmp(straddr, "::") != 0) {
	    fprintf(stderr, ":: != 0\n");
            goto bad;
          }
        } else {
          if (strcmp(straddr, "::1") != 0) {
	    fprintf(stderr, "::1 != 0\n");
            goto bad;
          }
        }
        inet6++;
        break;
      case AF_UNSPEC:
        fprintf(stderr, "AF_UNSPEC\n");
        goto bad;
        break;
      default:
        /* another family support? */
        break;
      }
    }
  }

  if (inet6 != 2 || inet4 != 2) {
    fprintf(stderr, "inet6 = %d, inet4 = %d\n", inet6, inet4);
    goto bad;
  }

  if (aitop)
    freeaddrinfo(aitop);
  exit(0);

 bad:
  if (aitop)
    freeaddrinfo(aitop);
  exit(1);
}

>Fix:
n/a
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: itojun 
State-Changed-When: Mon Jun 19 19:56:03 PDT 2000 
State-Changed-Why:  
pkgsrc/net/rsync/Makefile 1.28 should be okay.  could you try this one? 

From: Martin Husemann <martin@rumolt.teuto.de>
To: gnats-bugs@NetBSD.ORG
Cc:  
Subject: Re: pkg/10396
Date: Wed, 5 Jul 2000 21:10:25 +0200 (MEST)

 > pkgsrc/net/rsync/Makefile 1.28 should be okay.  could you try this one?

 Works for me. Thank's for fixing it.

 Martin
State-Changed-From-To: feedback->closed 
State-Changed-By: martin 
State-Changed-When: Wed Jul 5 12:19:19 PDT 2000 
State-Changed-Why:  
Problem is fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.