Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32829
b: refs/heads/master
c: 28658c8
h: refs/heads/master
i:
  32827: 7e5677f
v: v3
  • Loading branch information
Phil Oester authored and David S. Miller committed Jul 25, 2006
1 parent 4c0eacc commit 3c765c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8cf8fb5687bb37737ea419a0b2143aab49295779
refs/heads/master: 28658c8967da9083be83af0a37be3b190bae79da
12 changes: 11 additions & 1 deletion trunk/net/netfilter/xt_pkttype.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <linux/skbuff.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/in.h>
#include <linux/ip.h>

#include <linux/netfilter/xt_pkttype.h>
#include <linux/netfilter/x_tables.h>
Expand All @@ -28,9 +30,17 @@ static int match(const struct sk_buff *skb,
unsigned int protoff,
int *hotdrop)
{
u_int8_t type;
const struct xt_pkttype_info *info = matchinfo;

return (skb->pkt_type == info->pkttype) ^ info->invert;
if (skb->pkt_type == PACKET_LOOPBACK)
type = (MULTICAST(skb->nh.iph->daddr)
? PACKET_MULTICAST
: PACKET_BROADCAST);
else
type = skb->pkt_type;

return (type == info->pkttype) ^ info->invert;
}

static struct xt_match pkttype_match = {
Expand Down

0 comments on commit 3c765c9

Please sign in to comment.