Release 4.11 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 | 141 | 74.21% | 1 | 7.69% |
Arnaldo Carvalho de Melo | 21 | 11.05% | 3 | 23.08% |
Jan Engelhardt | 13 | 6.84% | 5 | 38.46% |
Patrick McHardy | 12 | 6.32% | 1 | 7.69% |
Yasuyuki Kozakai | 1 | 0.53% | 1 | 7.69% |
Alexey Dobriyan | 1 | 0.53% | 1 | 7.69% |
Hideaki Yoshifuji / 吉藤英明 | 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 | 13 | 81.25% | 1 | 33.33% |
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 | 12 | 80.00% | 1 | 33.33% |
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 | 215 | 66.56% | 3 | 13.64% |
Patrick McHardy | 39 | 12.07% | 4 | 18.18% |
Jan Engelhardt | 33 | 10.22% | 8 | 36.36% |
Arnaldo Carvalho de Melo | 21 | 6.50% | 3 | 13.64% |
Art Haas | 12 | 3.72% | 1 | 4.55% |
Hideaki Yoshifuji / 吉藤英明 | 1 | 0.31% | 1 | 4.55% |
Alexey Dobriyan | 1 | 0.31% | 1 | 4.55% |
Yasuyuki Kozakai | 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.