Release 4.8 net/ipv6/netfilter/ip6t_eui64.c
/* Kernel module to match EUI64 address parameters. */
/* (C) 2001-2002 Andras Kis-Szabo <kisza@sch.bme.hu>
*
* 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/ipv6.h>
#include <linux/if_ether.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
MODULE_DESCRIPTION("Xtables: IPv6 EUI64 address match");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static bool
eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par)
{
unsigned char eui64[8];
if (!(skb_mac_header(skb) >= skb->head &&
skb_mac_header(skb) + ETH_HLEN <= skb->data) &&
par->fragoff != 0) {
par->hotdrop = true;
return false;
}
memset(eui64, 0, sizeof(eui64));
if (eth_hdr(skb)->h_proto == htons(ETH_P_IPV6)) {
if (ipv6_hdr(skb)->version == 0x6) {
memcpy(eui64, eth_hdr(skb)->h_source, 3);
memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3);
eui64[3] = 0xff;
eui64[4] = 0xfe;
eui64[0] ^= 0x02;
if (!memcmp(ipv6_hdr(skb)->saddr.s6_addr + 8, eui64,
sizeof(eui64)))
return true;
}
}
return false;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
harald welte | harald welte | 141 | 74.21% | 1 | 7.69% |
arnaldo carvalho de melo | arnaldo carvalho de melo | 21 | 11.05% | 3 | 23.08% |
jan engelhardt | jan engelhardt | 13 | 6.84% | 5 | 38.46% |
patrick mchardy | patrick mchardy | 12 | 6.32% | 1 | 7.69% |
hideaki yoshifuji | hideaki yoshifuji | 1 | 0.53% | 1 | 7.69% |
yasuyuki kozakai | yasuyuki kozakai | 1 | 0.53% | 1 | 7.69% |
alexey dobriyan | alexey dobriyan | 1 | 0.53% | 1 | 7.69% |
| Total | 190 | 100.00% | 13 | 100.00% |
static struct xt_match eui64_mt6_reg __read_mostly = {
.name = "eui64",
.family = NFPROTO_IPV6,
.match = eui64_mt6,
.matchsize = sizeof(int),
.hooks = (1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_IN) |
(1 << NF_INET_FORWARD),
.me = THIS_MODULE,
};
static int __init eui64_mt6_init(void)
{
return xt_register_match(&eui64_mt6_reg);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
harald welte | harald welte | 13 | 81.25% | 1 | 33.33% |
jan engelhardt | jan engelhardt | 3 | 18.75% | 2 | 66.67% |
| Total | 16 | 100.00% | 3 | 100.00% |
static void __exit eui64_mt6_exit(void)
{
xt_unregister_match(&eui64_mt6_reg);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
harald welte | harald welte | 12 | 80.00% | 1 | 33.33% |
jan engelhardt | jan engelhardt | 3 | 20.00% | 2 | 66.67% |
| Total | 15 | 100.00% | 3 | 100.00% |
module_init(eui64_mt6_init);
module_exit(eui64_mt6_exit);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
harald welte | harald welte | 215 | 66.56% | 3 | 13.64% |
patrick mchardy | patrick mchardy | 39 | 12.07% | 4 | 18.18% |
jan engelhardt | jan engelhardt | 33 | 10.22% | 8 | 36.36% |
arnaldo carvalho de melo | arnaldo carvalho de melo | 21 | 6.50% | 3 | 13.64% |
art haas | art haas | 12 | 3.72% | 1 | 4.55% |
yasuyuki kozakai | yasuyuki kozakai | 1 | 0.31% | 1 | 4.55% |
hideaki yoshifuji | hideaki yoshifuji | 1 | 0.31% | 1 | 4.55% |
alexey dobriyan | alexey dobriyan | 1 | 0.31% | 1 | 4.55% |
| Total | 323 | 100.00% | 22 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.