From nobody@FreeBSD.org  Fri Feb 13 12:30:45 2009
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 ED7211065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 12:30:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 808ED8FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 12:30:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DCUiPI048542
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 12:30:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n1DCUiVM048541;
	Fri, 13 Feb 2009 12:30:44 GMT
	(envelope-from nobody)
Message-Id: <200902131230.n1DCUiVM048541@www.freebsd.org>
Date: Fri, 13 Feb 2009 12:30:44 GMT
From: Dmitrij Tejblum <tejblum@yandex-team.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] [if_vlan] Incorrect handling of mistakes in vlan creation
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         131642
>Category:       kern
>Synopsis:       [patch] [if_vlan] Incorrect handling of mistakes in vlan creation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 13 12:40:00 UTC 2009
>Closed-Date:    Fri Feb 20 07:17:42 UTC 2009
>Last-Modified:  Fri Feb 20 07:17:42 UTC 2009
>Originator:     Dmitrij Tejblum
>Release:        FreeBSD 7.1-STABLE
>Organization:
OOO Yandex
>Environment:
>Description:

>How-To-Repeat:
# # (Assume there is no vlan configured)
# ifconfig vlan10 create vlan 10 vlandev em0
# ifconfig vlan11 create vlan 10 vlandev em0
ifconfig: SIOCIFCREATE2: File exists
# # (Ok, that was mistake in vlan tag)
# ifconfig vlan11 create vlan 11 vlandev em0
ifconfig: SIOCIFCREATE2: File exists
# # Huh???
>Fix:


Patch attached with submission follows:

--- sys/net/if_vlan.c	2009-02-12 19:06:08.000000000 +0300
+++ sys/net/if_vlan.c	2009-02-13 15:18:27.000000000 +0300
@@ -742,6 +742,7 @@
 			ether_ifdetach(ifp);
 			vlan_unconfig(ifp);
 			if_free_type(ifp, IFT_ETHER);
+			ifc_free_unit(ifc, unit);
 			free(ifv, M_VLAN);
 
 			return (error);


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Fri Feb 13 13:00:06 UTC 2009 
State-Changed-Why:  
Fixed in HEAD.  Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/131642: commit references a PR
Date: Fri, 13 Feb 2009 13:00:26 +0000 (UTC)

 Author: maxim
 Date: Fri Feb 13 12:59:54 2009
 New Revision: 188575
 URL: http://svn.freebsd.org/changeset/base/188575
 
 Log:
   o In case of the error do not forget to deallocate a cloned device unit.
   
   PR:		kern/131642
   Submitted by:	Dmitrij Tejblum
   MFC after:	1 week
 
 Modified:
   head/sys/net/if_vlan.c
 
 Modified: head/sys/net/if_vlan.c
 ==============================================================================
 --- head/sys/net/if_vlan.c	Fri Feb 13 12:15:45 2009	(r188574)
 +++ head/sys/net/if_vlan.c	Fri Feb 13 12:59:54 2009	(r188575)
 @@ -746,6 +746,7 @@ vlan_clone_create(struct if_clone *ifc, 
  			ether_ifdetach(ifp);
  			vlan_unconfig(ifp);
  			if_free_type(ifp, IFT_ETHER);
 +			ifc_free_unit(ifc, unit);
  			free(ifv, M_VLAN);
  
  			return (error);
 _______________________________________________
 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: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Fri Feb 20 07:17:27 UTC 2009 
State-Changed-Why:  
Merged to RELENG_7. 

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