From owner-freebsd-bugs Wed Mar 24 3:30:24 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 B031D1548E for ; Wed, 24 Mar 1999 03:30:22 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id DAA18961; Wed, 24 Mar 1999 03:30:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Wed, 24 Mar 1999 03:30:03 -0800 (PST) Message-Id: <199903241130.DAA18961@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Joël Faedi" Subject: Re: bin/5139: portmap does not find interfaces correctly Reply-To: "Joël 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: "Joël Faedi" To: "Sheldon Hearn" Cc: Subject: Re: bin/5139: portmap does not find interfaces correctly Date: Wed, 24 Mar 1999 12:15:14 +0100 > >Okay, so could you send diffs against 1.7 ? The problem I had was that >it was impossible for me to comparre your code against the current code. >If you could send a diff, I can test it. > With the new code, the patch is very small: 1 line for the problem itself, other lines are only for cleaner code in TEST mode (no gcc warning). *** from_local-1.7-JF.c Wed Mar 24 12:10:01 1999 --- from_local-1.7.c Fri Mar 19 15:47:39 1999 *************** *** 40,46 **** static char sccsid[] = "@(#) from_local.c 1.2 93/11/16 21:50:02"; #endif static const char rcsid[] = ! "$Id: from_local.c,v 1.xxx 1999/03/24 11:25:49 xxx Exp $"; #endif #include --- 40,50 ---- static char sccsid[] = "@(#) from_local.c 1.2 93/11/16 21:50:02"; #endif static const char rcsid[] = ! "$Id: from_local.c,v 1.7 1998/08/17 06:05:55 jb Exp $"; ! #endif ! ! #ifdef TEST ! #undef perror #endif #include *************** *** 58,69 **** #include #include - #ifdef TEST - #include - #include - #include - #endif - #ifndef TRUE #define TRUE 1 #define FALSE 0 --- 62,67 ---- *************** *** 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) --- 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) *************** *** 180,195 **** #ifdef TEST - int main() { ! int res, i; ! res = find_local(); ! printf("results: num_local=%d find_local()=%d\n", num_local, res); for (i = 0; i < num_local; i++) printf("%s\n", inet_ntoa(addrs[i])); - exit(0); } #endif --- 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message