From owner-freebsd-bugs Fri May 28 5:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 4239F14C42 for ; Fri, 28 May 1999 05:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA51692; Fri, 28 May 1999 05:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 28 May 1999 05:50:03 -0700 (PDT) Message-Id: <199905281250.FAA51692@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Joel Faedi Subject: Re: bin/5139: portmap does not find interfaces correctly Reply-To: Joel Faedi Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/5139; it has been noted by GNATS. From: Joel Faedi To: sheldonh@iafrica.com Cc: Subject: Re: bin/5139: portmap does not find interfaces correctly Date: Wed, 7 Apr 1999 17:29:36 +0200 (MET DST) 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 #include #include --- 43,48 ---- *************** *** 62,67 **** --- 58,69 ---- #include #include + #ifdef TEST + #include + #include + #include + #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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message