Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 1995 08:38:59 -0400 (EDT)
From:      John Capo <jc@irbs.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: pppd & proxyarp & BSD
Message-ID:  <199505101239.IAA21612@irbs.irbs.com>
In-Reply-To: <AAp17il0A5@hq.sonet.kemerovo.su> from "Vladimir V. Davydoff" at May 10, 95 03:51:15 pm

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



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