From nobody@FreeBSD.org  Mon Aug  8 13:14:20 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B1C48106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Aug 2011 13:14:20 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A0C318FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Aug 2011 13:14:20 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p78DEKO6011641
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 8 Aug 2011 13:14:20 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p78DEKK8011623;
	Mon, 8 Aug 2011 13:14:20 GMT
	(envelope-from nobody)
Message-Id: <201108081314.p78DEKK8011623@red.freebsd.org>
Date: Mon, 8 Aug 2011 13:14:20 GMT
From: Svatopluk Kraus <onwahe@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] in_ifscrubprefix() - network route can be installed for interfaces marked down
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         159603
>Category:       kern
>Synopsis:       [netinet] [patch] in_ifscrubprefix() - network route can be installed for interfaces marked down
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 08 13:20:13 UTC 2011
>Closed-Date:    Fri Feb 07 19:02:05 UTC 2014
>Last-Modified:  Fri Feb 07 19:02:05 UTC 2014
>Originator:     Svatopluk Kraus
>Release:        current
>Organization:
>Environment:
>Description:
If interface goes down, then network route is deleted via in_ifscrubprefix()
and can be replaced by same one on another interface. Interfaces marked
down are not skipped during lookup.
>How-To-Repeat:

>Fix:
Index: sys/netinet/in.c
===================================================================
--- sys/netinet/in.c	(revision 224705)
+++ sys/netinet/in.c	(working copy)
@@ -1163,7 +1163,8 @@
 			p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
 		}
 
-		if (prefix.s_addr != p.s_addr)
+		if ((prefix.s_addr != p.s_addr) ||
+		    !(ia->ia_ifp->if_flags & IFF_UP))
 			continue;
 
 		/*


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Aug 14 10:30:14 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159603 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/159603: commit references a PR
Date: Sun, 28 Aug 2011 00:14:53 +0000 (UTC)

 Author: qingli
 Date: Sun Aug 28 00:14:40 2011
 New Revision: 225223
 URL: http://svn.freebsd.org/changeset/base/225223
 
 Log:
   When an interface address route is removed from the system, another
   route with the same prefix is searched for as a replacement. The
   current code did not bypass routes that have non-operational
   interfaces. This patch fixes that bug and will find a replacement
   route with an active interface.
   
   PR:		kern/159603
   Submitted by:	pluknet, ambrisko at ambrisko dot com
   Reviewed by:	discussed on net@
   Approved by:	re (bz)
   MFC after:	3 days
 
 Modified:
   head/sys/netinet/in.c
 
 Modified: head/sys/netinet/in.c
 ==============================================================================
 --- head/sys/netinet/in.c	Sat Aug 27 22:10:53 2011	(r225222)
 +++ head/sys/netinet/in.c	Sun Aug 28 00:14:40 2011	(r225223)
 @@ -1163,7 +1163,8 @@ in_scrubprefix(struct in_ifaddr *target,
  			p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
  		}
  
 -		if (prefix.s_addr != p.s_addr)
 +		if ((prefix.s_addr != p.s_addr) ||
 +		    !(ia->ia_ifp->if_flags & IFF_UP))
  			continue;
  
  		/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/159603: commit references a PR
Date: Mon, 10 Oct 2011 21:46:49 +0000 (UTC)

 Author: qingli
 Date: Mon Oct 10 21:46:37 2011
 New Revision: 226239
 URL: http://svn.freebsd.org/changeset/base/226239
 
 Log:
   MFC 225223
   
   When an interface address route is removed from the system, another
   route with the same prefix is searched for as a replacement. The
   current code did not bypass routes that have non-operational
   interfaces. This patch fixes that bug and will find a replacement
   route with an active interface.
   
   PR:		kern/159603
   Submitted by:	pluknet, ambrisko at ambrisko dot com
   Reviewed by:	discussed on net@
 
 Modified:
   stable/8/sys/netinet/in.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
 
 Modified: stable/8/sys/netinet/in.c
 ==============================================================================
 --- stable/8/sys/netinet/in.c	Mon Oct 10 21:43:53 2011	(r226238)
 +++ stable/8/sys/netinet/in.c	Mon Oct 10 21:46:37 2011	(r226239)
 @@ -1166,7 +1166,8 @@ in_scrubprefix(struct in_ifaddr *target,
  			p.s_addr &= ia->ia_sockmask.sin_addr.s_addr;
  		}
  
 -		if (prefix.s_addr != p.s_addr)
 +		if ((prefix.s_addr != p.s_addr) ||
 +		    !(ia->ia_ifp->if_flags & IFF_UP))
  			continue;
  
  		/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: Svatopluk Kraus <onwahe@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/159603: [netinet] [patch] in_ifscrubprefix() - network route
 can be installed for interfaces marked down
Date: Thu, 13 Oct 2011 11:21:16 +0200

 Thanks for commit. I think the PR can be closed.
State-Changed-From-To: open->closed 
State-Changed-By: hiren 
State-Changed-When: Fri Feb 7 19:01:19 UTC 2014 
State-Changed-Why:  
Fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159603 
>Unformatted:
