Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Aug 2002 19:08:43 +0800 (KRAST)
From:      Eugene Grosbein <eugen@www.svzserv.kemerovo.su>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/42120: arp(8) fails due to ioctl SIOCGIFNETMASK failure
Message-ID:  <200208281108.g7SB8hLh055925@www.svzserv.kemerovo.su>

next in thread | raw e-mail | index | archive | help

>Number:         42120
>Category:       kern
>Synopsis:       arp(8) fails due to ioctl SIOCGIFNETMASK failure
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 28 04:10:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD 4.6-STABLE

>Description:

	We have an ARP-proxy gateway box that used to announce its MAC address
	for number of IP addresses. It translates them using natd then.
	It ran 3.x for years without a problem. Today I've upgraded it
	to 4.6-STABLE, all services run find except of ARP proxying.

	This interface (fxp0) has an alias with netmask 0xffffffff.
	ifconfig fxp0 shows alias before primary ip address that
	has netmask 0xffffff00, it does this for unknown reason as
	my rc.conf is the same. Well, that's basically OK
	exect of the fact that 'arp client_ip auto pub' cannot find
	interface in this case.

>How-To-Repeat:
	
	Suppose we have fxp0 without IP address.
	Let's see:

	# ifconfig fxp0
	fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
		ether 00:90:27:35:05:1b
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active

	# ifconfig fxp0 inet 190.0.0.1 netmask 0xffffff00
	# ifconfig fxp0 inet 190.0.0.2 netmask 0xffffffff alias
	# ifconfig fxp0
	fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
		inet 190.0.0.1 netmask 0xffffff00 broadcast 190.0.0.255
		inet 190.0.0.2 netmask 0xffffffff broadcast 190.0.0.2
		ether 00:90:27:35:05:1b
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active
	# arp -a -d
	# arp -s 190.0.0.3 auto pub
	using interface fxp0 for proxy with address 00:90:27:35:05:1b
	# ping -c 1 190.0.0.1
	PING 190.0.0.1 (190.0.0.1): 56 data bytes
	64 bytes from 190.0.0.1: icmp_seq=0 ttl=64 time=0.295 ms
	
	--- 190.0.0.1 ping statistics ---
	1 packets transmitted, 1 packets received, 0% packet loss
	round-trip min/avg/max/stddev = 0.295/0.295/0.295/0.000 ms
	# arp -a -n
	? (190.0.0.1) at 00:90:27:35:05:1b on fxp0 permanent [ethernet]
	? (190.0.0.3) at 00:90:27:35:05:1b on fxp0 permanent published [ethernet]

	That's what expected. Now clean up and start from beginning.

	# ifconfig fxp0 delete
	# ifconfig fxp0 delete
	# arp -a -d
	# ifconfig fxp0
	fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
		ether 00:90:27:35:05:1b
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active

	But now make it go backwards (I don't know why it came to be
	in this way for my real box):
	
	# ifconfig fxp0 inet 190.0.0.2 netmask 0xffffffff
	# ifconfig fxp0 inet 190.0.0.1 netmask 0xffffff00 alias
	# ifconfig fxp0
		fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
		inet 190.0.0.2 netmask 0xffffffff broadcast 190.0.0.2
		inet 190.0.0.1 netmask 0xffffff00 broadcast 190.0.0.255
		ether 00:90:27:35:05:1b
		media: Ethernet autoselect (100baseTX <full-duplex>)
		status: active

	That's what I see after my box is loaded. Now try to play with ARP.
	# arp -a -d
	# arp -s 190.0.0.3 auto pub
	no interface found for 190.0.0.3

	arp(8) now cannot find an interface. I digged it for little
	and see that ioctl(sock,SIOCGIFNETMASK,&ifreq) returns
	0xffffffff twice for netmask, it does not return 0xffffff00
	so its really not arp's fault.

>Fix:

	Unknown for me. I was forced to rewrite my file for arp -f
	to not use 'auto' and use real MAC of fxp0 instead.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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