]> git.ipfire.org Git - people/ms/rstp.git/commitdiff
Fix null pointer dereference in bridge_bpdu_rcv
authorAlexander Yurchenko <a.yurchenko@scalaxy.ru>
Fri, 19 Feb 2010 09:26:34 +0000 (12:26 +0300)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Sun, 28 Mar 2010 22:56:38 +0000 (15:56 -0700)
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>
bridge_track.c

index be555decf79cc8055d22e22c6abf77457e715f38..f08c9f6af9d4ee6b2f6b240fd369e3d1faec0575 100644 (file)
@@ -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,);