From nobody@FreeBSD.org  Mon Feb 27 18:47:56 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A005B16A420
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2006 18:47:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4B33543D78
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2006 18:47:51 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1RIlpp3013342
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 27 Feb 2006 18:47:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k1RIlotu013341;
	Mon, 27 Feb 2006 18:47:50 GMT
	(envelope-from nobody)
Message-Id: <200602271847.k1RIlotu013341@www.freebsd.org>
Date: Mon, 27 Feb 2006 18:47:50 GMT
From: Onno Molenkamp <onno@flox.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: STP doesn't transmit its own bridge id
X-Send-Pr-Version: www-2.3

>Number:         93909
>Category:       kern
>Synopsis:       STP doesn't transmit its own bridge id
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    thompsa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 27 18:50:06 GMT 2006
>Closed-Date:    Mon Mar 06 03:45:46 GMT 2006
>Last-Modified:  Mon Mar 06 03:45:46 GMT 2006
>Originator:     Onno Molenkamp
>Release:        6.0-STABLE
>Organization:
>Environment:
FreeBSD duiveltje 6.0-STABLE FreeBSD 6.0-STABLE #0: Mon Jan 16 13:54:19 CET 2006     root@duiveltje:/usr/obj/usr/src/sys/DUIVELTJE  i386

>Description:
The code in net/bridgestp.c that builds up a packet to be transmitted over the network incorrectly puts the root id in the bridge id field.

I noticed this behaviour in 6.0-STABLE version from a while ago, but the bug still exists in current CVS.
>How-To-Repeat:
Use an if_bridge bridge with STP.
>Fix:
--- net/bridgestp.c     Tue Jan 10 00:53:40 2006
+++ net/bridgestp.c.new      Mon Feb 27 19:42:24 2006
@@ -269,13 +269,13 @@

        bpdu.cbu_rootpathcost = htonl(cu->cu_root_path_cost);

-       bpdu.cbu_bridgepri = htons(cu->cu_rootid >> 48);
-       bpdu.cbu_bridgeaddr[0] = cu->cu_rootid >> 40;
-       bpdu.cbu_bridgeaddr[1] = cu->cu_rootid >> 32;
-       bpdu.cbu_bridgeaddr[2] = cu->cu_rootid >> 24;
-       bpdu.cbu_bridgeaddr[3] = cu->cu_rootid >> 16;
-       bpdu.cbu_bridgeaddr[4] = cu->cu_rootid >> 8;
-       bpdu.cbu_bridgeaddr[5] = cu->cu_rootid >> 0;
+       bpdu.cbu_bridgepri = htons(cu->cu_bridge_id >> 48);
+       bpdu.cbu_bridgeaddr[0] = cu->cu_bridge_id >> 40;
+       bpdu.cbu_bridgeaddr[1] = cu->cu_bridge_id >> 32;
+       bpdu.cbu_bridgeaddr[2] = cu->cu_bridge_id >> 24;
+       bpdu.cbu_bridgeaddr[3] = cu->cu_bridge_id >> 16;
+       bpdu.cbu_bridgeaddr[4] = cu->cu_bridge_id >> 8;
+       bpdu.cbu_bridgeaddr[5] = cu->cu_bridge_id >> 0;

        bpdu.cbu_portid = htons(cu->cu_port_id);
        bpdu.cbu_messageage = htons(cu->cu_message_age);

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Mon Feb 27 19:26:08 UTC 2006 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93909 
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Tue Feb 28 00:20:52 UTC 2006 
State-Changed-Why:  
This has been commited (plus a few other fixes), thanks for the patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93909 
State-Changed-From-To: patched->closed 
State-Changed-By: thompsa 
State-Changed-When: Mon Mar 6 03:45:21 UTC 2006 
State-Changed-Why:  
MFC complete. 

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