Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194906
b: refs/heads/master
c: 1d1c397
h: refs/heads/master
v: v3
  • Loading branch information
Jan Engelhardt committed Mar 18, 2010
1 parent 124bbbf commit 8d0e71c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 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: 7d5f7ed802507999c22949b84686d03987fe57ec
refs/heads/master: 1d1c397db95f1c0cd95f6fa633c1e68acfaacec3
18 changes: 10 additions & 8 deletions trunk/net/netfilter/xt_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ MODULE_ALIAS("ip6t_mac");

static bool mac_mt(const struct sk_buff *skb, const struct xt_match_param *par)
{
const struct xt_mac_info *info = par->matchinfo;

/* Is mac pointer valid? */
return skb_mac_header(skb) >= skb->head &&
skb_mac_header(skb) + ETH_HLEN <= skb->data
/* If so, compare... */
&& ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr))
^ info->invert);
const struct xt_mac_info *info = par->matchinfo;
bool ret;

if (skb_mac_header(skb) < skb->head)
return false;
if (skb_mac_header(skb) + ETH_HLEN > skb->data)
return false;
ret = compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr) == 0;
ret ^= info->invert;
return ret;
}

static struct xt_match mac_mt_reg __read_mostly = {
Expand Down

0 comments on commit 8d0e71c

Please sign in to comment.