From owner-freebsd-hackers Wed Aug 9 05:34:56 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id FAA10677 for hackers-outgoing; Wed, 9 Aug 1995 05:34:56 -0700 Received: from irbs.irbs.com (irbs.com [199.182.75.129]) by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id FAA10655 for ; Wed, 9 Aug 1995 05:34:48 -0700 Received: (from jc@localhost) by irbs.irbs.com (8.6.11/8.6.6) id IAA28661; Wed, 9 Aug 1995 08:33:33 -0400 From: John Capo Message-Id: <199508091233.IAA28661@irbs.irbs.com> Subject: Re: client & server ppp To: gary@palmer.demon.co.uk (Gary Palmer) Date: Wed, 9 Aug 1995 08:33:32 -0400 (EDT) Cc: bde@zeta.org.au, cshenton@apollo.hq.nasa.gov, jc@irbs.com, freebsd-hackers@freebsd.org In-Reply-To: <438.807941657@palmer.demon.co.uk> from "Gary Palmer" at Aug 9, 95 05:14:17 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2566 Sender: hackers-owner@freebsd.org Precedence: bulk Gary Palmer writes: > > In message <199508090400.OAA03763@godzilla.zeta.org.au>, Bruce Evans writes: > >>again from home. FBSD pppd also consumes all CPU available: on a > >>system with two pppds, they both run at 50%. W.R.T. die-on-hangup and > > >I've never seen an overhead problem in pppd. > > I belive it's related to the problem with the non-working proxyarp > option. I've certainly seen this in post 2.0 system, and a friend was > griping at me for ages to fix it (not running pppd locally made it > difficult :-( ). > > I thought I saw a patch for the proxyarp problem floating around, and > it may have gone into the source tree, although a quick look through > usr.sbin/pppd/*.c's log messages doesn't show anything obvious. > I looked at this a while back and posed this question, nobody commented. >From get_ether_addr() in sys-bsd.c, line 666. The for loop terminates when ifr >= ifend. ifr is pointed to the next structure at the bottom of the for loop at line 696. The loop does not terminate due to the continues. Also, the mask obtained in line 690 is not the netmask. It is the interface address. On my system, all three sockaddr structs in the ifreq struct had the same address, the interface address. Am I missing something here? 666:/* * Scan through looking for an interface with an Internet * address on the same subnet as `ipaddr'. */ ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifr = ifc.ifc_req; ifr < ifend; ) { if (ifr->ifr_addr.sa_family == AF_INET) { ina = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); /* * Check that the interface is up, and not point-to-point * or loopback. */ if (ioctl(s, SIOCGIFFLAGS, &ifreq) < 0) continue; if ((ifreq.ifr_flags & (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|IFF_LOOPBACK|IFF_NOARP)) != (IFF_UP|IFF_BROADCAST)) continue; /* * Get its netmask and check that it's on the right subnet. */ if (ioctl(s, SIOCGIFNETMASK, &ifreq) < 0) continue; 690: mask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; if ((ipaddr & mask) != (ina & mask)) continue; break; } 696: ifr = (struct ifreq *) ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len); } John Capo IRBS Engineering