From novel@FreeBSD.org  Tue Oct 13 05:36:41 2009
Return-Path: <novel@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D7E3106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Oct 2009 05:36:41 +0000 (UTC)
	(envelope-from novel@FreeBSD.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B3248FC19
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Oct 2009 05:36:41 +0000 (UTC)
Received: from freefall.freebsd.org (localhost [127.0.0.1])
	by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n9D5aeho015277
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Oct 2009 05:36:40 GMT
	(envelope-from novel@freefall.freebsd.org)
Received: (from novel@localhost)
	by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n9D5aeMJ015276;
	Tue, 13 Oct 2009 05:36:40 GMT
	(envelope-from novel)
Message-Id: <200910130536.n9D5aeMJ015276@freefall.freebsd.org>
Date: Tue, 13 Oct 2009 05:36:40 GMT
From: Roman Bogorodskiy <novel@freebsd.org>
Reply-To: Roman Bogorodskiy <novel@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: several tun(4) interfaces can be created with same dst addr
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         139559
>Category:       kern
>Synopsis:       [tun] several tun(4) interfaces can be created with same dst addr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    qingli
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 13 05:40:01 UTC 2009
>Closed-Date:    
>Last-Modified:  Tue Mar 01 10:16:14 EST 2011
>Originator:     Roman Bogorodskiy
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:

>Description:
	I'm using -CURRENT for some time and I use tun(4) in pair with ppp(8).
	I have several connections and sometimes it happens that remote pair
	sends dst address that is already used on other tun(4) interface. Previously,
	ppp complained about "File exists" error when assigning a new address
	and redialed. Few days (maybe weeks) ago I've noted a regression: ppp
	complains about "File exists", but nevertheless address gets assigned
	to the interface. I've experimented a bit with it and I have an
	impression that there's some bug in SIOCAIFADDR implementation and it's
	not related to ppp directly. See the 'How-To-Repeat' section.

>How-To-Repeat:
	(09:09) novel@underworld:~ %> sudo ifconfig tun4 create
	(09:10) novel@underworld:~ %> sudo ifconfig tun5 create
	(09:10) novel@underworld:~ %> sudo ifconfig tun4 10.0.0.2 10.0.0.1
	(09:10) novel@underworld:~ %> ifconfig tun4
	tun4: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        	inet 10.0.0.2 --> 10.0.0.1 netmask 0xff000000
	(09:10) novel@underworld:~ %> ifconfig tun5
	tun5: flags=8010<POINTOPOINT,MULTICAST> metric 0 mtu 1500
	(09:10) novel@underworld:~ %> sudo ifconfig tun5 10.0.0.3 10.0.0.1
	ifconfig: ioctl (SIOCAIFADDR): File exists
	(09:18) novel@underworld:~ %> ifconfig tun5
	tun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
        	inet 10.0.0.3 --> 10.0.0.1 netmask 0xff000000
	(09:18) novel@underworld:~ %>

	As you can see, ifconfig throwed the "File exists", but for some reason
	address got assigned, which seems to be wrong to me. Though, data for
	tun5 wasn't added to the routing table.
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Oct 13 13:34:59 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139559 
Responsible-Changed-From-To: freebsd-net->qingli 
Responsible-Changed-By: qingli 
Responsible-Changed-When: Fri Dec 4 19:44:12 UTC 2009 
Responsible-Changed-Why:  
Take ownership of this bug. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=139559 
State-Changed-From-To: open->closed 
State-Changed-By: qingli 
State-Changed-When: Tue Jan 5 22:03:52 UTC 2010 
State-Changed-Why:  
Patch committed in svn r201282 fixes this bug. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=139559 
State-Changed-From-To: closed->open 
State-Changed-By: novel 
State-Changed-When: Wed Jan 6 21:50:39 UTC 2010 
State-Changed-Why:  
Still reproducable in exactly the same way as described in 
'how to repeat section'. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/139559: commit references a PR
Date: Fri,  8 Jan 2010 17:49:36 +0000 (UTC)

 Author: qingli
 Date: Fri Jan  8 17:49:24 2010
 New Revision: 201811
 URL: http://svn.freebsd.org/changeset/base/201811
 
 Log:
   Ensure an address is removed from the interface address
   list when the installation of that address fails.
   
   PR:		139559
 
 Modified:
   head/sys/netinet/in.c
 
 Modified: head/sys/netinet/in.c
 ==============================================================================
 --- head/sys/netinet/in.c	Fri Jan  8 17:47:37 2010	(r201810)
 +++ head/sys/netinet/in.c	Fri Jan  8 17:49:24 2010	(r201811)
 @@ -562,7 +562,7 @@ in_control(struct socket *so, u_long cmd
  		    (hostIsNew || maskIsNew))
  			error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0);
  		if (error != 0 && iaIsNew)
 -			goto out;
 +			break;
  
  		if ((ifp->if_flags & IFF_BROADCAST) &&
  		    (ifra->ifra_broadaddr.sin_family == AF_INET))
 _______________________________________________
 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"
 
State-Changed-From-To: open->patched 
State-Changed-By: eadler 
State-Changed-When: Tue Mar 1 10:16:13 EST 2011 
State-Changed-Why:  
committed in head (201811) 

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