NetBSD Problem Report #44647

From kardel@pip.acrys.com  Sun Feb 27 21:41:26 2011
Return-Path: <kardel@pip.acrys.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 3EFD963B8A7
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 27 Feb 2011 21:41:26 +0000 (UTC)
Message-Id: <201102272046.p1RKkloh005033@pip.acrys.com>
Date: Sun, 27 Feb 2011 21:46:47 +0100 (MET)
From: kardel@pip.acrys.com
Reply-To: kardel@pip.acrys.com
To: gnats-bugs@gnats.NetBSD.org
Subject: routed sometimes thinls kernel routes disappear
X-Send-Pr-Version: 3.95

>Number:         44647
>Category:       kern
>Synopsis:       routed somes thinls kernel routes disappear
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 27 21:45:00 +0000 2011
>Closed-Date:    Tue Jun 26 13:01:37 +0000 2012
>Last-Modified:  Mon Jul 02 21:30:02 +0000 2012
>Originator:     Frank Kardel
>Release:        5.99.47-20110227 i386
>Organization:

>Environment:

System: NetBSD pip.kardel.name 5.99.47 NetBSD 5.99.47 (PIPGEN) #5: Sat Feb 26 16:48:16 MET 2011 kardel@pip.kardel.name:/fs/raid1a/src/NetBSD/tc-merge/obj.i386/sys/arch/i386/compile/PIPGEN i386
Architecture: i386
Machine: i386
>Description:
	After upgrading (kernel+userland) to 5.99.47-20110227 I have static default routes randomly disappearing.
	Further investigation shows that routed finds disappearing kernel routes.
	Either it claims a missing route for 10.0.3.0/28->10.0.3.1 (interface msk0 is 10.0.3.1 netmask 0xfffffff0). routed's 
	attempt to add that route again gets an error EEXIST. Or it claims 0.0.0.0 -> <some ip> via the pppoe interface
	has disappeared. The pppoe interface is stable over the whole time. When routed thinks the default route has
	disappeared is successfully removes the route from the routing table -> then the internet connectivity is
	gone until the static default route is manually added again.

	Extract from routed debug log:
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	0.0.0.0 --> 217.0.116.31 disappeared from kernel
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0
	10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	route disappeared before RTM_DELETE 10.0.3.0/0      -->10.0.3.1        metric=0 flags=0

	And in syslog:
	2011-02-27T21:17:49.808954+01:00 pip.kardel.name routed 23534 - - 10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	2011-02-27T21:18:20.237604+01:00 pip.kardel.name routed 23534 - - write(rt_sock) RTM_ADD    10.0.3.0/28     -->10.0.3.1        metric=0 flags=0: File exists
	2011-02-27T21:22:49.809101+01:00 pip.kardel.name routed 23534 - - 10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	2011-02-27T21:23:20.238990+01:00 pip.kardel.name routed 23534 - - write(rt_sock) RTM_ADD    10.0.3.0/28     -->10.0.3.1        metric=0 flags=0: File exists
	2011-02-27T21:27:49.803619+01:00 pip.kardel.name routed 23534 - - 0.0.0.0 --> 217.0.116.31 disappeared from kernel
	2011-02-27T21:27:49.803727+01:00 pip.kardel.name routed 23534 - - 10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	2011-02-27T21:28:20.232260+01:00 pip.kardel.name routed 23534 - - write(rt_sock) RTM_ADD    10.0.3.0/28     -->10.0.3.1        metric=0 flags=0: File exists
	2011-02-27T21:32:49.795658+01:00 pip.kardel.name routed 23534 - - 10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	2011-02-27T21:33:19.792873+01:00 pip.kardel.name routed 23534 - - write(rt_sock) RTM_ADD    10.0.3.0/28     -->10.0.3.1        metric=0 flags=0: File exists
	2011-02-27T21:37:49.813876+01:00 pip.kardel.name routed 23534 - - 10.0.3.0/28 --> 10.0.3.1 disappeared from kernel
	2011-02-27T21:38:20.241299+01:00 pip.kardel.name routed 23534 - - write(rt_sock) RTM_ADD    10.0.3.0/28     -->10.0.3.1        metric=0 flags=0: File exists

	BTW: routed reads the routing table via sysctl.

>How-To-Repeat:
	Run 5.99.47 with pppoe internet connection and static default route + internal interface + routed.
	Watch routed error messages + disappearing static default route.
>Fix:
	maybe some fallout from 32/64 bit structure ABI stabilisation ?

>Release-Note:

>Audit-Trail:
From: Takahiro HAYASHI <hash@abox3.so-net.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: kardel@pip.acrys.com, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: kern/44647: routed sometimes thinls kernel routes disappear
Date: Tue, 01 Mar 2011 13:57:50 +0900

 This patch might help you.

 Index: src/sbin/routed/if.c
 ===================================================================
 RCS file: /cvsroot/src/sbin/routed/if.c,v
 retrieving revision 1.29
 diff -u -r1.29 if.c
 --- src/sbin/routed/if.c	13 Oct 2010 09:19:40 -0000	1.29
 +++ src/sbin/routed/if.c	28 Feb 2011 16:52:06 -0000
 @@ -641,6 +641,9 @@
  #ifdef _HAVE_SA_LEN
  	static struct sockaddr sa_zero;
  #endif
 +#if defined(__NetBSD__) && defined(RT_ROUNDUP)
 +#define ROUNDUP(a) RT_ROUNDUP(a)
 +#else
  #ifdef sgi
  #define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) - 1))) \
  		    : sizeof(__uint64_t))
 @@ -648,6 +651,7 @@
  #define ROUNDUP(a) ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) \
  		    : sizeof(long))
  #endif
 +#endif /* defined(__NetBSD__) && defined(RT_ROUNDUP) */


  	memset(info, 0, sizeof(*info));

 --
 Takahiro HAYASHI

From: Frank Kardel <kardel@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: Takahiro HAYASHI <hash@abox3.so-net.ne.jp>, kern-bug-people@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: kern/44647: routed sometimes thinls kernel routes disappear
Date: Sat, 05 Mar 2011 09:43:32 +0100

 That was exactly what was needed.

 routing is stable again an no more unexpected messages are generated by 
 routed.

 The fix should be committed.

 Frank

 On 03/01/11 06:00, Takahiro HAYASHI wrote:
 > The following reply was made to PR kern/44647; it has been noted by GNATS.
 >
 > From: Takahiro HAYASHI<hash@abox3.so-net.ne.jp>
 > To: gnats-bugs@NetBSD.org
 > Cc: kardel@pip.acrys.com, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
 >          netbsd-bugs@netbsd.org
 > Subject: Re: kern/44647: routed sometimes thinls kernel routes disappear
 > Date: Tue, 01 Mar 2011 13:57:50 +0900
 >
 >   This patch might help you.
 >
 >   Index: src/sbin/routed/if.c
 >   ===================================================================
 >   RCS file: /cvsroot/src/sbin/routed/if.c,v
 >   retrieving revision 1.29
 >   diff -u -r1.29 if.c
 >   --- src/sbin/routed/if.c	13 Oct 2010 09:19:40 -0000	1.29
 >   +++ src/sbin/routed/if.c	28 Feb 2011 16:52:06 -0000
 >   @@ -641,6 +641,9 @@
 >    #ifdef _HAVE_SA_LEN
 >    	static struct sockaddr sa_zero;
 >    #endif
 >   +#if defined(__NetBSD__)&&  defined(RT_ROUNDUP)
 >   +#define ROUNDUP(a) RT_ROUNDUP(a)
 >   +#else
 >    #ifdef sgi
 >    #define ROUNDUP(a) ((a)>  0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) - 1))) \
 >    		    : sizeof(__uint64_t))
 >   @@ -648,6 +651,7 @@
 >    #define ROUNDUP(a) ((a)>  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) \
 >    		    : sizeof(long))
 >    #endif
 >   +#endif /* defined(__NetBSD__)&&  defined(RT_ROUNDUP) */
 >
 >
 >    	memset(info, 0, sizeof(*info));
 >
 >   --
 >   Takahiro HAYASHI
 >
 >    

From: "Frank Kardel" <kardel@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44647 CVS commit: src/sbin/routed
Date: Sun, 24 Jun 2012 16:24:35 +0000

 Module Name:	src
 Committed By:	kardel
 Date:		Sun Jun 24 16:24:35 UTC 2012

 Modified Files:
 	src/sbin/routed: if.c

 Log Message:
 PR/44647: commit fix proposed by Takahiro HAYASHI
 verified to be working in -current and also helps NetBSD-6 BETA2


 To generate a diff of this commit:
 cvs rdiff -u -r1.29 -r1.30 src/sbin/routed/if.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: kardel@NetBSD.org
State-Changed-When: Tue, 26 Jun 2012 13:01:37 +0000
State-Changed-Why:
commited to -current (src/sbin/routed/if.c:1.30)
pullup request for NetBSD-6 sent


From: "Julian Coleman" <jdc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44647 CVS commit: [netbsd-6] src/sbin/routed
Date: Mon, 2 Jul 2012 21:28:09 +0000

 Module Name:	src
 Committed By:	jdc
 Date:		Mon Jul  2 21:28:09 UTC 2012

 Modified Files:
 	src/sbin/routed [netbsd-6]: if.c

 Log Message:
 Pull up revision 1.30 (requested by kardel in ticket #376).

 PR/44647: commit fix proposed by Takahiro HAYASHI
 verified to be working in -current and also helps NetBSD-6 BETA2


 To generate a diff of this commit:
 cvs rdiff -u -r1.29 -r1.29.8.1 src/sbin/routed/if.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:
 	<and append source date of snapshot, if applicable (one line).>

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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.