netfilter: ipset: fix interface comparision in hash-netiface sets
authorFlorian Westphal <fw@strlen.de>
Sun, 17 Jun 2012 09:56:46 +0000 (09:56 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 25 Jun 2012 10:03:21 +0000 (12:03 +0200)
commitef5b6e127761667f78d99b7510a3876077fe9abe
treef47a8122ac8fbb8bf7d76b2a4720a811e25dd3e2
parent8b8e4bc0391f8abbcdb9e1c54415bcc0f4f5a2a0
netfilter: ipset: fix interface comparision in hash-netiface sets

ifname_compare() assumes that skb->dev is zero-padded,
e.g 'eth1\0\0\0\0\0...'. This isn't always the case. e1000 driver does

strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1);

in e1000_probe(), so once device is registered dev->name memory contains
'eth1\0:0:3\0\0\0' (or something like that), which makes eth1 compare
fail.

Use plain strcmp() instead.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_hash_netiface.c