Aji, Srinivas [Thu, 10 May 2007 23:37:26 +0000 (16:37 -0700)]
RSTP testing - PATCH: BPDU length calculation
The bpdu_len sent to STP_OUT_tx_bpdu() excludes the ethernet and
and LLC headers, though the bpdu pointer points to the start of the
ethernet header. Given the types in rstplib/stp_bpdu.h, we need to
be sending a packet with (base, len) given by
(bpdu, bpdu_len + sizeof(MAC_HEADER_T) + sizeof(ETH_HEADER_T))
MAC_HEADER_T is dest and source ethernet addresses and ETH_HEADER_T
is the 802.2 part.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Aji, Srinivas [Thu, 10 May 2007 23:35:41 +0000 (16:35 -0700)]
RSTP testing - PATCH: source MAC address of BPDU
BPDU's were being sent out with an all zero source ethernet
address. These packets don't make it far in the receive path on
another bridge since bridge_handle_frame() checks for valid source
ethernet address and drops them if that isn't the case.
I needed to undo a change I made in rstplib/transmit.c, where I was
not setting source MAC address because the LLC layer was doing it.
TODO: We get notified when a port MAC address changes, so we should
cache it. Right now it uses SIOCGIFHWADDR each time (for each BPDU
sent) using a cached name, which is not good.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>