From nobody@FreeBSD.org  Sat Apr 30 19:12:38 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 6173E1065674
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Apr 2011 19:12:38 +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 4DAE08FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Apr 2011 19:12:38 +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 p3UJCbWT083634
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Apr 2011 19:12:37 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p3UJCbpX083631;
	Sat, 30 Apr 2011 19:12:37 GMT
	(envelope-from nobody)
Message-Id: <201104301912.p3UJCbpX083631@red.freebsd.org>
Date: Sat, 30 Apr 2011 19:12:37 GMT
From: Dmitrij Tejblum <tejblum@yandex-team.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [lagg] [patch] if_lagg should not treat vlan-tagged frames as LACP frames
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         156743
>Category:       kern
>Synopsis:       [lagg] [patch] if_lagg should not treat vlan-tagged frames as LACP frames
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thompsa
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 30 19:20:11 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue May 10 03:00:20 UTC 2011
>Originator:     Dmitrij Tejblum
>Release:        8.2-STABLE
>Organization:
OOO Yandex
>Environment:
>Description:
When if_lagg check if an input frame is a LACP (slow protocol) frame,  it can treat VLAN-tagged LACP frames as LACP frames, since the NIC could have removed the VLAN tag. Since LACP frames must not be send VLAN-tagged, if_lagg should check for that.

(Some broken switches sometimes incorrectly forward LACP frames to other ports, rather than handle them as LACP. It can result in VLAN-tagged LACP frames. If if_lagg receive such a forwarded LACP packet, it becomes confused. This patch provide some protection against this misbehaviour.)
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- sys/net/if_lagg.c.00	2011-02-25 14:05:35.000000000 +0300
+++ sys/net/if_lagg.c	2011-04-28 15:24:00.000000000 +0400
@@ -1831,11 +1831,11 @@ lagg_lacp_input(struct lagg_softc *sc, s
 
 	eh = mtod(m, struct ether_header *);
 	etype = ntohs(eh->ether_type);
 
 	/* Tap off LACP control messages */
-	if (etype == ETHERTYPE_SLOW) {
+	if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_SLOW) {
 		m = lacp_input(lp, m);
 		if (m == NULL)
 			return (NULL);
 	}
 


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Sat Apr 30 20:35:14 UTC 2011 
State-Changed-Why:  
Committed, thanks for the PR 


Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Sat Apr 30 20:35:14 UTC 2011 
Responsible-Changed-Why:  
Grab 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/156743: commit references a PR
Date: Sat, 30 Apr 2011 20:35:15 +0000 (UTC)

 Author: thompsa
 Date: Sat Apr 30 20:34:52 2011
 New Revision: 221270
 URL: http://svn.freebsd.org/changeset/base/221270
 
 Log:
   LACP frames must not be send VLAN-tagged, check for that before processing.
   
   PR:		kern/156743
   Submitted by:	Dmitrij Tejblum
   MFC after:	1 week
 
 Modified:
   head/sys/net/if_lagg.c
 
 Modified: head/sys/net/if_lagg.c
 ==============================================================================
 --- head/sys/net/if_lagg.c	Sat Apr 30 20:16:49 2011	(r221269)
 +++ head/sys/net/if_lagg.c	Sat Apr 30 20:34:52 2011	(r221270)
 @@ -1794,7 +1794,7 @@ lagg_lacp_input(struct lagg_softc *sc, s
  	etype = ntohs(eh->ether_type);
  
  	/* Tap off LACP control messages */
 -	if (etype == ETHERTYPE_SLOW) {
 +	if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_SLOW) {
  		m = lacp_input(lp, m);
  		if (m == NULL)
  			return (NULL);
 _______________________________________________
 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/156743: commit references a PR
Date: Tue, 10 May 2011 02:58:27 +0000 (UTC)

 Author: thompsa
 Date: Tue May 10 02:58:08 2011
 New Revision: 221721
 URL: http://svn.freebsd.org/changeset/base/221721
 
 Log:
   MFC r221270
   
    LACP frames must not be send VLAN-tagged, check for that before processing.
   
   PR:		kern/156743
   Submitted by:	Dmitrij Tejblum
 
 Modified:
   stable/8/sys/net/if_lagg.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/net/if_lagg.c
 ==============================================================================
 --- stable/8/sys/net/if_lagg.c	Tue May 10 02:38:44 2011	(r221720)
 +++ stable/8/sys/net/if_lagg.c	Tue May 10 02:58:08 2011	(r221721)
 @@ -1786,7 +1786,7 @@ lagg_lacp_input(struct lagg_softc *sc, s
  	etype = ntohs(eh->ether_type);
  
  	/* Tap off LACP control messages */
 -	if (etype == ETHERTYPE_SLOW) {
 +	if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_SLOW) {
  		m = lacp_input(lp, m);
  		if (m == NULL)
  			return (NULL);
 _______________________________________________
 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"
 
>Unformatted:
