From sheldonh@axl.noc.iafrica.com Fri May 28 05:48:01 1999
Return-Path: <sheldonh@axl.noc.iafrica.com>
Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175])
	by hub.freebsd.org (Postfix) with ESMTP id CC60415AE9
	for <freebsd-gnats-submit@freebsd.org>; Fri, 28 May 1999 05:47:55 -0700 (PDT)
	(envelope-from sheldonh@axl.noc.iafrica.com)
Received: from sheldonh (helo=axl.noc.iafrica.com)
	by axl.noc.iafrica.com with local-esmtp (Exim 3.00 #1)
	id 10nM3F-0000bE-00
	for freebsd-gnats-submit@freebsd.org; Fri, 28 May 1999 14:47:53 +0200
Received: from relay01.iafrica.com ([196.7.0.160])
	by axl.noc.iafrica.com with esmtp (Exim 2.12 #1)
	id 10UuH8-000EPS-00
	for sheldonh@axl.noc.iafrica.com; Wed, 7 Apr 1999 17:29:58 +0200
Received: from [192.33.169.251] (helo=cerbere.scinfo.u-nancy.fr)
	by relay01.iafrica.com with esmtp (Exim 1.92 #3)
	for sheldonh@iafrica.com
	id 10UuGu-0005rl-00; Wed, 7 Apr 1999 17:29:45 +0200
Received: from zeus.scinfo.u-nancy.fr (zeus.scinfo.u-nancy.fr [192.33.169.5])
	by cerbere.scinfo.u-nancy.fr (8.8.8-scinfo/8.8.8-scinfo) with ESMTP id RAA09582
	for <sheldonh@iafrica.com>; Wed, 7 Apr 1999 17:29:37 +0200 (CEST)
Received: (from faedi@localhost)
	by zeus.scinfo.u-nancy.fr (8.8.8-scinfo/8.8.8-scinfo) id RAA05696
	for sheldonh@iafrica.com; Wed, 7 Apr 1999 17:29:36 +0200 (MET DST)
Message-Id: <199904071529.RAA05696@zeus.scinfo.u-nancy.fr>
Date: Wed, 7 Apr 1999 17:29:36 +0200 (MET DST)
From: Joel Faedi <Joel.Faedi@esial.u-nancy.fr>
To: sheldonh@iafrica.com
Subject: new patch for from_local.c

>Number:         11910
>Category:       bin
>Synopsis:       new patch for from_local.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 28 05:50:01 PDT 1999
>Closed-Date:    Tue Jun 8 03:42:20 PDT 1999
>Last-Modified:  Tue Jun  8 03:43:37 PDT 1999
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 Here is a better patch file...
 
 generated with:
 1) ftp ftp://ftp.freebsd.org/pub/FreeBSD/branches/-current/src/usr.sbin/portmap/from_local.c
 2) diff -c from_local.c from_local.c.new > from_local.patch
 
 Here is the file "from_local.patch"
 
 *** from_local.c	Mon Aug 17 12:13:45 1998
 --- from_local.c.new	Wed Apr  7 17:28:26 1999
 ***************
 *** 43,52 ****
   	"$Id: from_local.c,v 1.7 1998/08/17 06:05:55 jb Exp $";
   #endif
   
 - #ifdef TEST
 - #undef perror
 - #endif
 - 
   #include <sys/types.h>
   #include <sys/ioctl.h>
   #include <sys/socket.h>
 --- 43,48 ----
 ***************
 *** 62,67 ****
 --- 58,69 ----
   #include <net/if_dl.h>
   #include <netinet/in.h>
   
 + #ifdef TEST
 + #include <arpa/inet.h>
 + #include <string.h>
 + #include <stdio.h>
 + #endif
 + 
   #ifndef TRUE
   #define	TRUE	1
   #define FALSE	0
 ***************
 *** 135,141 ****
       else if (ifr.ifr_flags & IFF_UP)    /* active interface */
         if (ioctl(s, SIOCGIFADDR, &ifr) < 0)
           perror("SIOCGIFADDR");
 !       else {
           if (alloced < num_local + 1) {
             alloced += ESTIMATED_LOCAL;
             if (addrs)
 --- 137,143 ----
       else if (ifr.ifr_flags & IFF_UP)    /* active interface */
         if (ioctl(s, SIOCGIFADDR, &ifr) < 0)
           perror("SIOCGIFADDR");
 !       else if (ifr.ifr_addr.sa_family == AF_INET) { /* IP net interface only */
           if (alloced < num_local + 1) {
             alloced += ESTIMATED_LOCAL;
             if (addrs)
 ***************
 *** 178,191 ****
   
   #ifdef TEST
   
   main()
   {
 !     char   *inet_ntoa();
 !     int     i;
   
 !     find_local();
       for (i = 0; i < num_local; i++)
   	printf("%s\n", inet_ntoa(addrs[i]));
   }
   
   #endif
 --- 180,194 ----
   
   #ifdef TEST
   
 + int
   main()
   {
 !     int     res, i;
   
 !     res = find_local();
       for (i = 0; i < num_local; i++)
   	printf("%s\n", inet_ntoa(addrs[i]));
 +     exit(0);
   }
   
   #endif
 
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sat May 29 21:06:44 PDT 1999 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Tue Jun 8 03:42:20 PDT 1999 
State-Changed-Why:  
Opened in error while trying to bounce received mail into an existing 
PR 5139 as followup. 
>Unformatted:
