From owner-freebsd-bugs Wed Feb 5 06:24:32 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA17030 for bugs-outgoing; Wed, 5 Feb 1997 06:24:32 -0800 (PST) Received: from who.cdrom.com (who.cdrom.com [204.216.27.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA16976; Wed, 5 Feb 1997 06:24:05 -0800 (PST) Received: from horus.imag.fr (horus.imag.fr [129.88.38.2]) by who.cdrom.com (8.7.5/8.6.11) with ESMTP id GAA16476 ; Wed, 5 Feb 1997 06:24:03 -0800 (PST) Received: (from richier@localhost) by horus.imag.fr (8.8.1/8.6.9) id PAA14008; Wed, 5 Feb 1997 15:22:40 +0100 (MET) Date: Wed, 5 Feb 1997 15:22:40 +0100 (MET) From: Jean-Luc Richier Message-Id: <199702051422.PAA14008@horus.imag.fr> In-Reply-To: FreeBSD-gnats@freefall.freebsd.org's message as of Feb 5, 5:40. Organization: IMAG, Grenoble, France X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: FreeBSD-gnats@freefall.freebsd.org, freebsd-bugs@freefall.freebsd.org Subject: Re: bin/2668: modification suggested for rarpd Cc: Francis.Dupont@inria.fr Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Dans votre courrier du 5 Feb 5:40 vous ecrivez : >Thank you very much for your problem report. >It has the internal identification `bin/2668'. >The individual assigned to look at your >bug is: freebsd-bugs. > >>Category: bin >>Responsible: freebsd-bugs >>Synopsis: modification suggested for rarpd >>Arrival-Date: Wed Feb 5 05:40:02 PST 1997 Following a remark of Theo de Raadt about a memory leak in my suggested patch, here is a updated version I hope this wille help you *** rarpd.c.DIST Thu Mar 21 19:28:23 1996 --- rarpd.c Wed Feb 5 15:17:37 1997 *************** *** 193,198 **** --- 193,203 ---- char *ifname; { struct if_info *p; + int fd; + + fd = rarp_open(ifname); + if (fd < 0) + return; p = (struct if_info *)malloc(sizeof(*p)); if (p == 0) { *************** *** 202,208 **** p->ii_next = iflist; iflist = p; ! p->ii_fd = rarp_open(ifname); lookup_eaddr(ifname, p->ii_eaddr); lookup_ipaddr(ifname, &p->ii_ipaddr, &p->ii_netmask); } --- 207,213 ---- p->ii_next = iflist; iflist = p; ! p->ii_fd = fd; lookup_eaddr(ifname, p->ii_eaddr); lookup_ipaddr(ifname, &p->ii_ipaddr, &p->ii_netmask); } *************** *** 317,322 **** --- 322,331 ---- } (void) strncpy(ifr.ifr_name, device, sizeof ifr.ifr_name); if (ioctl(fd, BIOCSETIF, (caddr_t) & ifr) < 0) { + if (aflag) { /* for -a skip not ethernet interfaces */ + close(fd); + return -1; + } err(FATAL, "BIOCSETIF: %s", strerror(errno)); /* NOTREACHED */ } *************** *** 327,332 **** --- 336,345 ---- /* NOTREACHED */ } if (dlt != DLT_EN10MB) { + if (aflag) { /* for -a skip not ethernet interfaces */ + close(fd); + return -1; + } err(FATAL, "%s is not an ethernet", device); /* NOTREACHED */ } -- Jean-Luc RICHIER (Jean-Luc.Richier@Imag.Fr richier@imag.fr) Laboratoire Logiciels, Systemes et Reseaux (LSR-IMAG) IMAG-CAMPUS, BP 53, F-38041 GRENOBLE Cedex 9 Tel : (33) 4 76 82 72 32 Fax : (33) 4 76 82 72 87