From owner-freebsd-bugs Wed May 10 05:39:25 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id FAA18781 for bugs-outgoing; Wed, 10 May 1995 05:39:25 -0700 Received: from irbs.irbs.com (irbs.com [199.182.75.129]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id FAA18775 for ; Wed, 10 May 1995 05:39:20 -0700 Received: (from jc@localhost) by irbs.irbs.com (8.6.11/8.6.6) id IAA21612 for freebsd-bugs@freebsd.org; Wed, 10 May 1995 08:39:00 -0400 From: John Capo Message-Id: <199505101239.IAA21612@irbs.irbs.com> Subject: Re: pppd & proxyarp & BSD To: freebsd-bugs@FreeBSD.org Date: Wed, 10 May 1995 08:38:59 -0400 (EDT) In-Reply-To: from "Vladimir V. Davydoff" at May 10, 95 03:51:15 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1494 Sender: bugs-owner@FreeBSD.org Precedence: bulk Vladimir V. Davydoff writes: > > A little :-) bug was found in ppp-2.1.2/sys-bsd.c. It prevents > 'proxyarp' options to work. Bug is in get_ether_address(), in getting > interface netmask. Netmask is got from kernel, but doesn't used. > --- ppp-2.1.2/sys-bsd.c 685,693 --- > > /* > > * Get its netmask and check that it's on the right subnet. > > */ > > if (ioctl(s, SIOCGIFNETMASK, &ifreq) < 0) > > continue; > Now we get right netmask of ethernet. > > mask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; > ^^^^^^ > Now we use not netmask, but the ethernet address. Need '&ifreq.'. > > if ((ipaddr & mask) != (ina & mask)) > > continue; > Some addresses work but some not, has infinitive loop. Depend on result > of AND operation between two addresses :-) Load average up, pppd doesn't > die after disconnecting... > This has been reported numerous times. The loop at line 671 in sys-bsd.c _will not_ terminate once a continue statement is hit since the increment part of the loop is after the continues. The address obtained at line 690 is the interface address and not the netmask. This code will work for some people. It depends on the number of interfaces and the order that they are marked up. If someone can show me how the for loop terminates once a continue is hit, I will shut up and take the hat for a while. John Capo