NetBSD Problem Report #9444

Received: (qmail 7344 invoked from network); 18 Feb 2000 23:45:46 -0000
Message-Id: <200002182345.PAA24888@capsicum.wsrcc.com>
Date: Fri, 18 Feb 2000 15:45:44 -0800 (PST)
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
Reply-To: wolfgang@wsrcc.com
To: gnats-bugs@gnats.netbsd.org
Subject: netbsd doesn't send gratuitious arps when an interface comes up
X-Send-Pr-Version: 3.95

>Number:         9444
>Category:       kern
>Synopsis:       netbsd doesn't send gratuitious arps when an interface comes up
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 18 15:48:00 +0000 2000
>Closed-Date:    Sun May 01 05:26:00 +0000 2016
>Last-Modified:  Sun May 01 05:26:00 +0000 2016
>Originator:     Wolfgang Rupprecht
>Release:        NetBSD-current 2/13/2000
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Environment:

System: NetBSD capsicum.wsrcc.com 1.4S NetBSD 1.4S (WSRCC) #0: Sun Feb 13 18:54:32 PST 2000 wolfgang@capsicum.wsrcc.com:/v/src/netbsd/NetBSD-current/usr/src/sys/arch/i386/compile/WSRCC i386


>Description:
	When netbsd boots it fails to send any gratuitous arps.  

	Ideally netbsd would send an arp-request for its own IP address
	whenever the interface was first made active or had any changes
	in its IP address (or MAC address for that matter).

	When switching interface cards, this can cause longish waits
	as the other machines on the net try to use the old MAC
	address.

>How-To-Repeat:
	on MACHINE-A:   tcpdump -e -i tlp0 -n ether host MACHINE-B
	on MACHINE-B:   reboot

	Note that MACHINE-B reboots without ever sending an arp for its
	own IP address.

>Fix:

>Release-Note:
>Audit-Trail:

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: wolfgang@wsrcc.com
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface 
 comes up
Date: Tue, 01 Apr 2003 15:26:21 +0200

 While looking for a different thing, I stumbled over this PR.

 >         When netbsd boots it fails to send any gratuitous arps.  

 This is most definitely not true for current systems. From code inspection,
 NetBSD-1.5 already had this piece of code (netinet/if_arp.c:arp_ifinit())
 in it.
 OK to close the PR?

 best regards
 Matthias




From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: M.Drochner@fz-juelich.de
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface 
 comes up
Date: Tue, 1 Apr 2003 09:02:09 -0800

 Matthias Drochner writes:
 > While looking for a different thing, I stumbled over this PR.
 > 
 > >         When netbsd boots it fails to send any gratuitous arps.  
 > 
 > This is most definitely not true for current systems. From code inspection,
 > NetBSD-1.5 already had this piece of code (netinet/if_arp.c:arp_ifinit())
 > in it.
 > OK to close the PR?

 The code might well be there, but I still don't see any gratuitous
 arps using tcpdump on another machine.  Do you actually see the arps?

 It is entirely possible that my 10/100 hub or the tlp0 takes a few
 instants to negotiate 10 Mb/sec vs. 100 Mb/sec with the hub and drops
 the first few packets.  I have no idea.

 (BTW. The first packet I see is an arp *request* packet where the
 booting machine asks the main server/gateway for its MAC address.)

 -wolfgang
 -- 
 Wolfgang S. Rupprecht  <wolfgang@wsrcc.com>  http://www.wsrcc.com/wolfgang/

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface 
 comes up
Date: Tue, 01 Apr 2003 19:36:53 +0200

 wolfgang@wsrcc.com said:
 > The code might well be there, but I still don't see any gratuitous
 > arps using tcpdump on another machine.  Do you actually see the arps? 

 Just checked with -current again: yes, initially and also when I add
 addresses later with "ifconfig ... alias".

 > (BTW. The first packet I see is an arp *request* packet where the
 > booting machine asks the main server/gateway for its MAC address.)

 In my case there is some IPv6 stuff first:
 HBH icmp6: multicast listener report
 icmp6: neighbor sol

 where the latter seems to be the IPv6 equivalent of the gratutious ARP.

 best regards
 Matthias





From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: M.Drochner@fz-juelich.de
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface 
 comes up
Date: Tue, 1 Apr 2003 10:16:59 -0800

 Matthias Drochner writes:
 > Just checked with -current again: yes, initially and also when I add
 > addresses later with "ifconfig ... alias".

 I do see the gratuitous arp when adding an alias.  I don't see it when
 first booting or when doing an "ifconfig tlp0 down" "ifconfig tlp0
 up".  It looks even more like a timing issue than before.

 Just for the record, I'm running a Jan 11, 2003 -current, with an
 older SMC 10/100 card.

 Apr  1 10:05:04 scoville /netbsd: tlp0 at pci0 dev 15 function 0: DECchip 21140A Ethernet, pass 2.0
 Apr  1 10:05:04 scoville /netbsd: tlp0: broken MicroWire interface detected; setting SROM size to 1Kb

 Is your ethernet card nailed up to particular speed or does it
 autonegotiate the speed?

 > where the latter seems to be the IPv6 equivalent of the gratutious ARP.

 I saw this on one booting, but on the next one it wasn't there.

 -wolfgang
 -- 
 Wolfgang S. Rupprecht  <wolfgang@wsrcc.com>  http://www.wsrcc.com/wolfgang/

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface 
 comes up
Date: Wed, 02 Apr 2003 20:44:35 +0200

 wolfgang@wsrcc.com said:
 > It looks even more like a timing issue than before.

 Yes, probably.

 > Is your ethernet card nailed up to particular speed or does it
 > autonegotiate the speed?

 I've tried it with a laptop and a "wi" wireless card. Between the
 tcpdump and the access point are 2 switches.
 Maybe I've disabled "spanning tree" there.

 best regards
 Matthias


State-Changed-From-To: open->feedback 
State-Changed-By: perry 
State-Changed-When: Sun Apr 6 09:50:51 PDT 2003 
State-Changed-Why:  
Awaiting further information on whether this is an arp bug or a tlp 
driver bug. 

From: "Perry E. Metzger" <perry@piermont.com>
To: wolfgang@wsrcc.com
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de, perry@piermont.com
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: 06 Apr 2003 12:50:44 -0400

 > > It looks even more like a timing issue than before.
 > 
 > Yes, probably.

 Any further progress on this? I'd like us to be able to resolve it
 rather than letting it rot and the conversation seems to have died a
 week ago. If it really is a bug in the tlp driver it would be nice to
 verify that, close out 9444, and open a new PR indicating the tlp
 driver bug...

 Perry

From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: "Perry E. Metzger" <perry@piermont.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: Sun, 6 Apr 2003 11:59:28 -0700

 > > > It looks even more like a timing issue than before.
 > > Yes, probably.
 > Any further progress on this? I'd like us to be able to resolve it
 > rather than letting it rot and the conversation seems to have died a
 > week ago. If it really is a bug in the tlp driver it would be nice to
 > verify that, close out 9444, and open a new PR indicating the tlp
 > driver bug...

 If a driver bug, it is not limited to tlp.  I can also see the same
 behavior on rtk driver.  No gratuitous arp on initial boot, but I can
 see one with "ifconfig rtk0 alias ...".

 -wolfgang
 -- 
 Wolfgang S. Rupprecht  <wolfgang@wsrcc.com>  http://www.wsrcc.com/wolfgang/

From: "Perry E. Metzger" <perry@piermont.com>
To: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: 06 Apr 2003 15:09:29 -0400

 "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com> writes:
 > > > > It looks even more like a timing issue than before.
 > > > Yes, probably.
 > > Any further progress on this? I'd like us to be able to resolve it
 > > rather than letting it rot and the conversation seems to have died a
 > > week ago. If it really is a bug in the tlp driver it would be nice to
 > > verify that, close out 9444, and open a new PR indicating the tlp
 > > driver bug...
 > 
 > If a driver bug, it is not limited to tlp.  I can also see the same
 > behavior on rtk driver.  No gratuitous arp on initial boot, but I can
 > see one with "ifconfig rtk0 alias ...".

 So is it possible that the issue is a widespread tendency of drivers
 to accept packets for transmission before they are capable of actually
 transmitting them?

 Perry

From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: "Perry E. Metzger" <perry@piermont.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: Sun, 6 Apr 2003 13:22:18 -0700

 Perry E. Metzger writes:
 > "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com> writes:
 > > If a driver bug, it is not limited to tlp.  I can also see the same
 > > behavior on rtk driver.  No gratuitous arp on initial boot, but I can
 > > see one with "ifconfig rtk0 alias ...".
 > 
 > So is it possible that the issue is a widespread tendency of drivers
 > to accept packets for transmission before they are capable of actually
 > transmitting them?

 Yes.  That's what it looks like.

 The problem may also be related to my DLINK DSH-8 10/100 hub.  For all
 I know it may be a bit slower than other hubs in negotiating the
 100Mb/sec operation.

 -wolfgang

From: "Perry E. Metzger" <perry@piermont.com>
To: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: 06 Apr 2003 16:30:00 -0400

 "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com> writes:
 > Perry E. Metzger writes:
 > > "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com> writes:
 > > > If a driver bug, it is not limited to tlp.  I can also see the same
 > > > behavior on rtk driver.  No gratuitous arp on initial boot, but I can
 > > > see one with "ifconfig rtk0 alias ...".
 > > 
 > > So is it possible that the issue is a widespread tendency of drivers
 > > to accept packets for transmission before they are capable of actually
 > > transmitting them?
 > 
 > Yes.  That's what it looks like.

 Okay, one thing you might be able to do to prove this: putting printfs
 around the code that sends out the gratuitous arp and seeing if it
 triggers when you ifconfig the interface up. Could you do that?

 > The problem may also be related to my DLINK DSH-8 10/100 hub.  For all
 > I know it may be a bit slower than other hubs in negotiating the
 > 100Mb/sec operation.
 > 
 > -wolfgang
 > 

 -- 
 Perry E. Metzger		perry@piermont.com

From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: "Perry E. Metzger" <perry@piermont.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: Mon, 7 Apr 2003 07:31:07 -0700

 Perry E. Metzger writes:
 > Okay, one thing you might be able to do to prove this: putting printfs
 > around the code that sends out the gratuitous arp and seeing if it
 > triggers when you ifconfig the interface up. Could you do that?

 Ok, I added the following code and I do see the initial and final
 printfs.  The arprequest() code is running from start to finish.  A
 concurrent tcpdump run on another machine doesn't see the arp request.

 --- if_arp.c.~1.92.~	Sat Mar  1 05:43:31 2003
 +++ if_arp.c	Sun Apr  6 14:08:19 2003
 @@ -615,6 +615,8 @@
  	struct arphdr *ah;
  	struct sockaddr sa;

 +	if (sip == tip) printf ("Gratuitous arp start\n"); /* XXX -wr */
 +
  	if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL)
  		return;
  	MCLAIM(m, &arpdomain.dom_mowner);
 @@ -654,6 +656,8 @@
  	arpstat.as_sndtotal++;
  	arpstat.as_sndrequest++;
  	(*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0);
 +
 +	if (sip == tip) printf ("Gratuitous arp finish\n"); /* XXX -wr */
  }

  /*


 BTW. I tried running a -current kernel with a jan 17 userland.  Result
 f*cked up superblocks on all mounted ffs partitions.  Backup
 superblock ok.

 -wolfgang

From: "Perry E. Metzger" <perry@piermont.com>
To: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: 07 Apr 2003 11:40:44 -0400

 "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com> writes:
 > Perry E. Metzger writes:
 > > Okay, one thing you might be able to do to prove this: putting printfs
 > > around the code that sends out the gratuitous arp and seeing if it
 > > triggers when you ifconfig the interface up. Could you do that?
 > 
 > Ok, I added the following code and I do see the initial and final
 > printfs.  The arprequest() code is running from start to finish.  A
 > concurrent tcpdump run on another machine doesn't see the arp request.

 Okay, so that nails it.

 What's the list of devices this is known to happen on again, and are
 there any where we are sure it does not happen?

 Perry

From: "Wolfgang S. Rupprecht" <wolfgang@wsrcc.com>
To: "Perry E. Metzger" <perry@piermont.com>
Cc: gnats-bugs@netbsd.org, M.Drochner@fz-juelich.de
Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up
Date: Mon, 7 Apr 2003 08:48:51 -0700

 Perry E. Metzger writes:
 > What's the list of devices this is known to happen on again, and are
 > there any where we are sure it does not happen?

 Fails:
 	tlp
 	rtk

 works:
 	le

 I can test an "ep" later today.

 -wolfgang

From: "Perry E. Metzger" <perry@piermont.com>
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: kern/9444
Date: 07 Apr 2003 14:10:11 -0400

 From: Jason R Thorpe <thorpej@wasabisystems.com>
 To: "Perry E. Metzger" <perry@piermont.com>
 Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org
 Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up

 On Mon, Apr 07, 2003 at 01:26:40PM -0400, Perry E. Metzger wrote:

  > That might actually explain some related problems I've had with the
  > awi driver, too.
  > 
  > What needs to be done, approximately? If we log it on the ticket,
  > we'll at least not need to re-analyze this later.

 Driver "start" functions need to wait until link comes up on the interface.
 The callback routines from MII->MAC should call the start function when a
 DOWN->UP link transition occurs.

 But there are other problems:

 	1. This could cause spurious errors to be returned to user
 	   applications (or logged on the console) if the link takes
 	   a while to come up and the interface's queue reaches its
 	   limit.

 	2. User applications also need to know when the link makes
 	   a DOWN->UP transition.  Right now that is there for drivers
 	   that use the MII code (the MII code sends a message on the
 	   routing socket).  However, any driver which does NOT use the
 	   MII code does not send this message.

 	   In order for applications such as dhclient to be able to
 	   reliably use that message, all drivers need to send it.

 	   Alternatively, applications like dhclient need to explicitly
 	   poll the media status of all of their interfaces before using
 	   them.

 -- 
         -- Jason R. Thorpe <thorpej@wasabisystems.com>

From: "Perry E. Metzger" <perry@piermont.com>
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: kern/9444
Date: 07 Apr 2003 14:11:06 -0400

 From: Jason R Thorpe <thorpej@wasabisystems.com>
 To: "Perry E. Metzger" <perry@piermont.com>
 Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org
 Subject: Re: kern/9444: netbsd doesn't send gratuitious arps when an interface comes up

 On Sun, Apr 06, 2003 at 07:10:12PM -0000, Perry E. Metzger wrote:

  >  So is it possible that the issue is a widespread tendency of drivers
  >  to accept packets for transmission before they are capable of actually
  >  transmitting them?

 That is actually a known problem; fixing it is straight-forward, but
 invasive.

 -- 
         -- Jason R. Thorpe <thorpej@wasabisystems.com>
State-Changed-From-To: feedback->analyzed 
State-Changed-By: fair 
State-Changed-When: Thu May 29 04:52:05 UTC 2003 
State-Changed-Why:  
Feedback has been provided, and an analysis agreed upon. 
From: Roy Marples <roy@marples.name>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/9444
Date: Tue, 13 Oct 2015 14:16:27 +0100

 I recently changed our network stack to support IN_IFF_TENTATIVE and
 friends in a similar vein to IN6_IFF_TENTATIVE which have been around
 for a very long time.

 I also made a change a while ago that when the link state goes DOWN, all
 addresses are marked as IN{,6}_IFF_DETATCHED and when it goes UP all
 addresses marked are marked as IN{,6}_IFF_TENTATIVE and the resptive DAD
 process happens.

 For INET, ARP reqests are resent and when valid, the gratuitous ARP is
 sent. This sequence of fixes should address this PR which I stumbled
 upon by accident today. A current kernel from mid May 2015 should have
 all the fixes needed to test with.

 Roy

State-Changed-From-To: analyzed->feedback
State-Changed-By: roy@NetBSD.org
State-Changed-When: Tue, 13 Oct 2015 13:21:57 +0000
State-Changed-Why:
Initial problem should now be fixed.


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 May 2016 05:26:00 +0000
State-Changed-Why:
Feedback timeout.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.