summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Yurchenko <a.yurchenko@scalaxy.ru>2010-02-19 12:26:34 +0300
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-03-28 15:56:38 -0700
commitb79b9a98650cd8018141874d2a5e59c1cd78ea3c (patch)
treeda76a9baf0d1ee3aac1536ffa89a49c4043a9aab
parent18da741b5f843f196b7a1ba8d85da8506a1a58f6 (diff)
downloadrstp-b79b9a98650cd8018141874d2a5e59c1cd78ea3c.tar.gz
Fix null pointer dereference in bridge_bpdu_rcv
Check that the interface on which bpdu was received is actually a bridge port. It's possible to receive an STP packet on a bridge interface itself if the bridge has STP disabled and forwards STP traffic. Signed-off-by: Alexander Yurchenko <a.yurchenko@scalaxy.ru>
-rw-r--r--bridge_track.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bridge_track.c b/bridge_track.c
index be555de..f08c9f6 100644
--- a/bridge_track.c
+++ b/bridge_track.c
@@ -579,7 +579,7 @@ void bridge_bpdu_rcv(int if_index, const unsigned char *data, int len)
BPDU_T *bpdu = (BPDU_T *) (data + sizeof(MAC_HEADER_T));
LOG("ifindex %d, len %d", if_index, len);
- if (!ifc)
+ if (!ifc || !ifc->master)
return;
TST(ifc->up,);