Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78820
b: refs/heads/master
c: 57de0ab
h: refs/heads/master
v: v3
  • Loading branch information
Jan Engelhardt authored and David S. Miller committed Jan 28, 2008
1 parent 9f1f5c7 commit b353a7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 13b0e83b5b52d1a0ab87772ecc93fe91b2740386
refs/heads/master: 57de0abbffa9724e2a89860a49725d805bfc07ca
18 changes: 11 additions & 7 deletions trunk/net/netfilter/xt_pkttype.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/if_packet.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>

#include <linux/netfilter/xt_pkttype.h>
#include <linux/netfilter/x_tables.h>
Expand All @@ -27,16 +28,19 @@ pkttype_mt(const struct sk_buff *skb, const struct net_device *in,
const void *matchinfo, int offset, unsigned int protoff,
bool *hotdrop)
{
u_int8_t type;
const struct xt_pkttype_info *info = matchinfo;
u_int8_t type;

if (skb->pkt_type == PACKET_LOOPBACK)
type = match->family == AF_INET &&
ipv4_is_multicast(ip_hdr(skb)->daddr)
? PACKET_MULTICAST
: PACKET_BROADCAST;
else
if (skb->pkt_type != PACKET_LOOPBACK)
type = skb->pkt_type;
else if (match->family == AF_INET &&
ipv4_is_multicast(ip_hdr(skb)->daddr))
type = PACKET_MULTICAST;
else if (match->family == AF_INET6 &&
ipv6_hdr(skb)->daddr.s6_addr[0] == 0xFF)
type = PACKET_MULTICAST;
else
type = PACKET_BROADCAST;

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

0 comments on commit b353a7a

Please sign in to comment.