Subject: bin/711: pppd(8) 'proxyarp' option fails
To: None <gnats-admin@NetBSD.ORG>
From: Scott Reynolds <scottr@Plexus.COM>
List: netbsd-bugs
Date: 01/06/1995 23:35:04
>Number:         711
>Category:       bin
>Synopsis:       /usr/sbin/pppd doesn't add a proxy ARP entry properly
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan  6 23:35:01 1995
>Originator:     
>Organization:
Scott Reynolds
Assistant System Administrator
Technology Group, Inc.
>Release:        NetBSD-current 06-Jan-95
>Environment:
System: NetBSD aqua 1.0A NetBSD 1.0A (TGI) #1: Tue Jan 3 14:23:37 CST 1995 scottr@mach1355.pc.tgi.plexus.com:/usr/src/sys/arch/i386/compile/TGI i386


>Description:
	pppd doesn't properly add ARP entries when using the 'proxyarp'
	option due to a typo in sys-bsd.c.  This fix was originally proposed
	as a part of two patches from eranian@mountain.ufr-info-p7.ibp.fr,
	but apparently got lost somewhere.

>How-To-Repeat:
	My system is on a class C network (192.56.116.0), and I dial in with
	a PC with a packet driver.  The PC works fine with other PPP dialups,
	so that isn't an issue.

	The following options are in my /etc/ppp/options file:

	:192.56.116.xxx  <-- 'xxx' is of course numeric
	proxyarp
	-detach
	modem
	crtscts

	I start pppd from either an account I set up directly, with
	/usr/sbin/pppd as the login shell, or from my regular account
	manually.  Without the patch below, an arp entry never appears
	for 192.56.116.xxx, and the result is some very strange behavior
	by the gateway machine running pppd.

>Fix:
	Apply the following patch.

*** usr.sbin/pppd/sys-bsd.c-dist	Sat Dec 24 05:51:59 1994
--- usr.sbin/pppd/sys-bsd.c	Sat Jan  7 00:53:02 1994
***************
*** 619,625 ****
--- 619,625 ----
  	     */
  	    if (ioctl(s, SIOCGIFNETMASK, &ifreq) < 0)
  		continue;
-  	    mask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr;
+ 	    mask = ((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr.s_addr;
  	    if ((ipaddr & mask) != (ina & mask))
  		continue;
  
>Audit-Trail:
>Unformatted: