/* Kernel module to match MAC address parameters. */ /* (C) 1999-2001 Paul `Rusty' Russell * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/skbuff.h> #include <linux/if_arp.h> #include <linux/if_ether.h> #include <linux/etherdevice.h> #include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv6.h> #include <linux/netfilter/xt_mac.h> #include <linux/netfilter/x_tables.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>"); MODULE_DESCRIPTION("Xtables: MAC address match"); MODULE_ALIAS("ipt_mac"); MODULE_ALIAS("ip6t_mac");
static bool mac_mt(const struct sk_buff *skb, struct xt_action_param *par) { const struct xt_mac_info *info = par->matchinfo; bool ret; if (skb->dev == NULL || skb->dev->type != ARPHRD_ETHER) return false; if (skb_mac_header(skb) < skb->head) return false; if (skb_mac_header(skb) + ETH_HLEN > skb->data) return false; ret = ether_addr_equal(eth_hdr(skb)->h_source, info->srcaddr); ret ^= info->invert; return ret; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 50 | 48.08% | 6 | 46.15% |
Linus Torvalds (pre-git) | 40 | 38.46% | 1 | 7.69% |
Arnaldo Carvalho de Melo | 9 | 8.65% | 2 | 15.38% |
Linus Torvalds | 2 | 1.92% | 1 | 7.69% |
Patrick McHardy | 1 | 0.96% | 1 | 7.69% |
Joe Perches | 1 | 0.96% | 1 | 7.69% |
Harald Welte | 1 | 0.96% | 1 | 7.69% |
Total | 104 | 100.00% | 13 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 10 | 62.50% | 1 | 20.00% |
Jan Engelhardt | 4 | 25.00% | 2 | 40.00% |
Harald Welte | 1 | 6.25% | 1 | 20.00% |
Patrick McHardy | 1 | 6.25% | 1 | 20.00% |
Total | 16 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 9 | 60.00% | 1 | 25.00% |
Jan Engelhardt | 4 | 26.67% | 2 | 50.00% |
Harald Welte | 2 | 13.33% | 1 | 25.00% |
Total | 15 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 87 | 33.21% | 1 | 4.17% |
Jan Engelhardt | 69 | 26.34% | 8 | 33.33% |
Harald Welte | 50 | 19.08% | 3 | 12.50% |
Patrick McHardy | 37 | 14.12% | 6 | 25.00% |
Arnaldo Carvalho de Melo | 9 | 3.44% | 2 | 8.33% |
Art Haas | 4 | 1.53% | 1 | 4.17% |
Kris Katterjohn | 3 | 1.15% | 1 | 4.17% |
Linus Torvalds | 2 | 0.76% | 1 | 4.17% |
Joe Perches | 1 | 0.38% | 1 | 4.17% |
Total | 262 | 100.00% | 24 | 100.00% |