Release 4.8 net/ipv6/netfilter/ip6t_REJECT.c
/*
* IP6 tables REJECT target module
* Linux INET6 implementation
*
* Copyright (C)2003 USAGI/WIDE Project
*
* Authors:
* Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
*
* Copyright (c) 2005-2007 Patrick McHardy <kaber@trash.net>
*
* Based on net/ipv4/netfilter/ipt_REJECT.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/gfp.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/icmpv6.h>
#include <linux/netdevice.h>
#include <net/icmp.h>
#include <net/flow.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter_ipv6/ip6t_REJECT.h>
#include <net/netfilter/ipv6/nf_reject.h>
MODULE_AUTHOR("Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>");
MODULE_DESCRIPTION("Xtables: packet \"rejection\" target for IPv6");
MODULE_LICENSE("GPL");
static unsigned int
reject_tg6(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct ip6t_reject_info *reject = par->targinfo;
struct net *net = par->net;
switch (reject->with) {
case IP6T_ICMP6_NO_ROUTE:
nf_send_unreach6(net, skb, ICMPV6_NOROUTE, par->hooknum);
break;
case IP6T_ICMP6_ADM_PROHIBITED:
nf_send_unreach6(net, skb, ICMPV6_ADM_PROHIBITED, par->hooknum);
break;
case IP6T_ICMP6_NOT_NEIGHBOUR:
nf_send_unreach6(net, skb, ICMPV6_NOT_NEIGHBOUR, par->hooknum);
break;
case IP6T_ICMP6_ADDR_UNREACH:
nf_send_unreach6(net, skb, ICMPV6_ADDR_UNREACH, par->hooknum);
break;
case IP6T_ICMP6_PORT_UNREACH:
nf_send_unreach6(net, skb, ICMPV6_PORT_UNREACH, par->hooknum);
break;
case IP6T_ICMP6_ECHOREPLY:
/* Do nothing */
break;
case IP6T_TCP_RESET:
nf_send_reset6(net, skb, par->hooknum);
break;
case IP6T_ICMP6_POLICY_FAIL:
nf_send_unreach6(net, skb, ICMPV6_POLICY_FAIL, par->hooknum);
break;
case IP6T_ICMP6_REJECT_ROUTE:
nf_send_unreach6(net, skb, ICMPV6_REJECT_ROUTE, par->hooknum);
break;
}
return NF_DROP;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 100 | 53.48% | 1 | 10.00% |
andreas herz | andreas herz | 34 | 18.18% | 1 | 10.00% |
alexey dobriyan | alexey dobriyan | 18 | 9.63% | 1 | 10.00% |
jan engelhardt | jan engelhardt | 17 | 9.09% | 3 | 30.00% |
herbert xu | herbert xu | 7 | 3.74% | 1 | 10.00% |
eric leblond | eric leblond | 6 | 3.21% | 1 | 10.00% |
stanislav fomichev | stanislav fomichev | 4 | 2.14% | 1 | 10.00% |
eric w. biederman | eric w. biederman | 1 | 0.53% | 1 | 10.00% |
| Total | 187 | 100.00% | 10 | 100.00% |
static int reject_tg6_check(const struct xt_tgchk_param *par)
{
const struct ip6t_reject_info *rejinfo = par->targinfo;
const struct ip6t_entry *e = par->entryinfo;
if (rejinfo->with == IP6T_ICMP6_ECHOREPLY) {
pr_info("ECHOREPLY is not supported.\n");
return -EINVAL;
} else if (rejinfo->with == IP6T_TCP_RESET) {
/* Must specify that it's a TCP packet */
if (!(e->ipv6.flags & IP6T_F_PROTO) ||
e->ipv6.proto != IPPROTO_TCP ||
(e->ipv6.invflags & XT_INV_PROTO)) {
pr_info("TCP_RESET illegal for non-tcp\n");
return -EINVAL;
}
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 71 | 65.74% | 2 | 20.00% |
jan engelhardt | jan engelhardt | 19 | 17.59% | 6 | 60.00% |
pablo neira ayuso | pablo neira ayuso | 11 | 10.19% | 1 | 10.00% |
harald welte | harald welte | 7 | 6.48% | 1 | 10.00% |
| Total | 108 | 100.00% | 10 | 100.00% |
static struct xt_target reject_tg6_reg __read_mostly = {
.name = "REJECT",
.family = NFPROTO_IPV6,
.target = reject_tg6,
.targetsize = sizeof(struct ip6t_reject_info),
.table = "filter",
.hooks = (1 << NF_INET_LOCAL_IN) | (1 << NF_INET_FORWARD) |
(1 << NF_INET_LOCAL_OUT),
.checkentry = reject_tg6_check,
.me = THIS_MODULE
};
static int __init reject_tg6_init(void)
{
return xt_register_target(&reject_tg6_reg);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 13 | 81.25% | 2 | 50.00% |
jan engelhardt | jan engelhardt | 3 | 18.75% | 2 | 50.00% |
| Total | 16 | 100.00% | 4 | 100.00% |
static void __exit reject_tg6_exit(void)
{
xt_unregister_target(&reject_tg6_reg);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 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(reject_tg6_init);
module_exit(reject_tg6_exit);
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
patrick mchardy | patrick mchardy | 302 | 65.65% | 7 | 26.92% |
jan engelhardt | jan engelhardt | 64 | 13.91% | 10 | 38.46% |
andreas herz | andreas herz | 34 | 7.39% | 1 | 3.85% |
alexey dobriyan | alexey dobriyan | 18 | 3.91% | 1 | 3.85% |
pablo neira ayuso | pablo neira ayuso | 11 | 2.39% | 1 | 3.85% |
eric leblond | eric leblond | 9 | 1.96% | 1 | 3.85% |
harald welte | harald welte | 7 | 1.52% | 1 | 3.85% |
herbert xu | herbert xu | 7 | 1.52% | 1 | 3.85% |
stanislav fomichev | stanislav fomichev | 4 | 0.87% | 1 | 3.85% |
tejun heo | tejun heo | 3 | 0.65% | 1 | 3.85% |
eric w. biederman | eric w. biederman | 1 | 0.22% | 1 | 3.85% |
| Total | 460 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.