Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 1995 08:33:32 -0400 (EDT)
From:      John Capo <jc@irbs.com>
To:        gary@palmer.demon.co.uk (Gary Palmer)
Cc:        bde@zeta.org.au, cshenton@apollo.hq.nasa.gov, jc@irbs.com, freebsd-hackers@freebsd.org
Subject:   Re: client & server ppp
Message-ID:  <199508091233.IAA28661@irbs.irbs.com>
In-Reply-To: <438.807941657@palmer.demon.co.uk> from "Gary Palmer" at Aug 9, 95 05:14:17 am

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508091233.IAA28661>