From owner-freebsd-net@FreeBSD.ORG Wed Aug 2 23:07:34 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D82316A4DF for ; Wed, 2 Aug 2006 23:07:34 +0000 (UTC) (envelope-from fbsd@synoptic.org) Received: from gort.synoptic.org (gort.synoptic.org [216.254.17.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CDF343D45 for ; Wed, 2 Aug 2006 23:07:34 +0000 (GMT) (envelope-from fbsd@synoptic.org) Received: by gort.synoptic.org (Postfix, from userid 1000) id 1A20F6352811; Wed, 2 Aug 2006 16:07:34 -0700 (PDT) Date: Wed, 2 Aug 2006 16:07:34 -0700 From: Matthew Hudson To: freebsd-net@freebsd.org Message-ID: <20060802230734.GA75240@gort.synoptic.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: Can't create proxy-arp entries for subnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2006 23:07:34 -0000 Hello everybody, I believe I may have stumbled across a bug in the arp program and the reproduction is simple (and should be easy to verify) so I'll just jump to the point. This is on 6.1-RELEASE-p3 i386 I discovered this while trying to create proxy-arp entries for a subnet of a network I was directly connected to. The smaller subnet is forwarded over a tun interface. Basically, the network plugged into fxp0 is 2.2.2.0/24 however there's a small subnet (2.2.2.8/30) that lives on the other side of the tun2 interface and I want to proxy arp for it so other hosts on the wire can reach it without static routes. Basic repro instructions: # dd if=/dev/zero of=/dev/tun count=0 ## create new tun interface # ifconfig tun2 1.1.1.1 1.1.1.2 # ifconfig fxp0 2.2.2.1/24 # route add 2.2.2.8/30 1.1.1.2 add net 2.2.2.8: gateway 1.1.1.2 # arp -s 2.2.2.9 auto pub using interface fxp0 for proxy with address 00:90:27:a5:cd:33 cannot intuit interface index and type for 2.2.2.9 The "cannot intuit interace index and type" is the failure. The workaround is to add the static arp entries before you add the subnet route, however it seems like this is still a bug. Can anyone else verify that this shouldn't be? Here's a more detailed log of the reproduction along with comments. Comments are preceded by ']]' ---- script(1) start ---- # netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.48.254 UGS 0 3066 em0 127.0.0.1 127.0.0.1 UH 0 0 lo0 192.168.48 link#2 UC 0 0 em0 Internet6: Destination Gateway Flags Netif Expire ::1 ::1 UH lo0 ff01:4::/32 ::1 UC lo0 ff02::%lo0/32 ::1 UC lo0 ]] simple enough. Note that fxp0 is completely unconfigured. ]] The network on em0 should be entirely unrelated here but is shown ]] to illustrate 'nothing up my sleeve' # ifconfig -a fxp0: flags=8843 mtu 1500 options=8 ether 00:90:27:a5:cd:33 media: Ethernet autoselect (100baseTX ) status: active em0: flags=8843 mtu 1500 options=b inet 192.168.48.154 netmask 0xffffff00 broadcast 192.168.48.255 ether 00:08:74:38:3f:ef media: Ethernet autoselect (100baseTX ) status: active lo0: flags=8049 mtu 16384 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 tun2: flags=8051 mtu 1500 ]] Again, we see fxp0 is unconfigured. tun2 is unconfigured as well. # ifconfig tun2 1.1.1.1 1.1.1.2 # ifconfig fxp0 2.2.2.1/24 # route add 2.2.2.8/30 1.1.1.2 add net 2.2.2.8: gateway 1.1.1.2 ]] We configure an address on tun2, fxp0, and set up the /30 subnet to ]] route over tun2. # arp -s 2.2.2.9 auto pub using interface fxp0 for proxy with address 00:90:27:a5:cd:33 cannot intuit interface index and type for 2.2.2.9 ]] Here's the problem. ]] "cannot intuit interface index and type for 2.2.2.9" # route delete 2.2.2.8/30 delete net 2.2.2.8 # arp -s 2.2.2.9 auto pub using interface fxp0 for proxy with address 00:90:27:a5:cd:33 ]] However if we delete the route, we can add the proxy arp no problem. # route add 2.2.2.8/30 1.1.1.2 add net 2.2.2.8: gateway 1.1.1.2 ]] We can even add the route *back* once the proxy arp is created. # arp -d 2.2.2.9 2.2.2.9 (2.2.2.9) deleted # arp -s 2.2.2.9 auto pub using interface fxp0 for proxy with address 00:90:27:a5:cd:33 cannot intuit interface index and type for 2.2.2.9 ]] However if we try to delete the proxy arp and then re-create it, no dice. ]] note the broken-symmetry. ---- script(1) end ---- Cheers, Matthew