]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[NETFILTER]: nfnetlink_log: fix crash on bridged packet
authorPatrick McHardy <kaber@trash.net>
Sat, 24 Mar 2007 20:30:53 +0000 (21:30 +0100)
committerAdrian Bunk <bunk@stusta.de>
Sat, 24 Mar 2007 20:30:53 +0000 (21:30 +0100)
physoutdev is only set on purely bridged packet, when nfnetlink_log is used
in the OUTPUT/FORWARD/POSTROUTING hooks on packets forwarded from or to a
bridge it crashes when trying to dereference skb->nf_bridge->physoutdev.

Reported by Holger Eitzenberger <heitzenberger@astaro.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
net/netfilter/nfnetlink_log.c

index c35be233eaa21d419cf7a4ed6e0cb1aa985976c7..885d95eb9c6a7708f705a39284a97bfa7e4c0772 100644 (file)
@@ -476,7 +476,7 @@ __build_packet_message(struct nfulnl_instance *inst,
                         * for physical device (when called from ipv4) */
                        NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV,
                                sizeof(tmp_uint), &tmp_uint);
-                       if (skb->nf_bridge) {
+                       if (skb->nf_bridge && skb->nf_bridge->physoutdev) {
                                tmp_uint = 
                                    htonl(skb->nf_bridge->physoutdev->ifindex);
                                NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV,