summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorNicolas Cavallari <cavallar@lri.fr>2011-06-16 17:27:04 +0200
committerPatrick McHardy <kaber@trash.net>2011-06-16 17:27:04 +0200
commit2c38de4c1f8da799bdca0e4bb40ca13f2174d3e8 (patch)
treef4c30741b465cdca9f533c74d9694884186badf4 /net/ipv4
parentdb898aa2ef6529fa80891e754d353063611c77de (diff)
downloadlinux-3.10-2c38de4c1f8da799bdca0e4bb40ca13f2174d3e8.tar.gz
linux-3.10-2c38de4c1f8da799bdca0e4bb40ca13f2174d3e8.tar.bz2
linux-3.10-2c38de4c1f8da799bdca0e4bb40ca13f2174d3e8.zip
netfilter: fix looped (broad|multi)cast's MAC handling
By default, when broadcast or multicast packet are sent from a local application, they are sent to the interface then looped by the kernel to other local applications, going throught netfilter hooks in the process. These looped packet have their MAC header removed from the skb by the kernel looping code. This confuse various netfilter's netlink queue, netlink log and the legacy ip_queue, because they try to extract a hardware address from these packets, but extracts a part of the IP header instead. This patch prevent NFQUEUE, NFLOG and ip_QUEUE to include a MAC header if there is none in the packet. Signed-off-by: Nicolas Cavallari <cavallar@lri.fr> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/ip_queue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index f7f9bd7ba12..5c9b9d96391 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -203,7 +203,8 @@ ipq_build_packet_message(struct nf_queue_entry *entry, int *errp)
else
pmsg->outdev_name[0] = '\0';
- if (entry->indev && entry->skb->dev) {
+ if (entry->indev && entry->skb->dev &&
+ entry->skb->mac_header != entry->skb->network_header) {
pmsg->hw_type = entry->skb->dev->type;
pmsg->hw_addrlen = dev_parse_header(entry->skb,
pmsg->hw_addr);