Skip to content

Commit 3941d33

Browse files
Nikolay Aleksandrovgregkh
authored andcommitted
net: bridge: stp: don't cache eth dest pointer before skb pull
[ Upstream commit 2446a68 ] Don't cache eth dest pointer before calling pskb_may_pull. Fixes: cf0f02d ("[BRIDGE]: use llc for receiving STP packets") Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 829fba2 commit 3941d33

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/bridge/br_stp_bpdu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ void br_send_tcn_bpdu(struct net_bridge_port *p)
147147
void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
148148
struct net_device *dev)
149149
{
150-
const unsigned char *dest = eth_hdr(skb)->h_dest;
151150
struct net_bridge_port *p;
152151
struct net_bridge *br;
153152
const unsigned char *buf;
@@ -176,7 +175,7 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
176175
if (p->state == BR_STATE_DISABLED)
177176
goto out;
178177

179-
if (!ether_addr_equal(dest, br->group_addr))
178+
if (!ether_addr_equal(eth_hdr(skb)->h_dest, br->group_addr))
180179
goto out;
181180

182181
if (p->flags & BR_BPDU_GUARD) {

0 commit comments

Comments
 (0)