Release 4.9 net/netfilter/core.c
/* netfilter.c: look after the filters for various protocols.
* Heavily influenced by the old firewall.c by David Bonn and Alan Cox.
*
* Thanks to Rob `CmdrTaco' Malda for not influencing this code in any
* way.
*
* Rusty Russell (C)2000 -- This code is GPL.
* Patrick McHardy (c) 2006-2012
*/
#include <linux/kernel.h>
#include <linux/netfilter.h>
#include <net/protocol.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/wait.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/netfilter_ipv6.h>
#include <linux/inetdevice.h>
#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/rcupdate.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include "nf_internals.h"
static DEFINE_MUTEX(afinfo_mutex);
const struct nf_afinfo __rcu *nf_afinfo[NFPROTO_NUMPROTO] __read_mostly;
EXPORT_SYMBOL(nf_afinfo);
const struct nf_ipv6_ops __rcu *nf_ipv6_ops __read_mostly;
EXPORT_SYMBOL_GPL(nf_ipv6_ops);
DEFINE_PER_CPU(bool, nf_skb_duplicated);
EXPORT_SYMBOL_GPL(nf_skb_duplicated);
int nf_register_afinfo(const struct nf_afinfo *afinfo)
{
mutex_lock(&afinfo_mutex);
RCU_INIT_POINTER(nf_afinfo[afinfo->family], afinfo);
mutex_unlock(&afinfo_mutex);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| patrick mchardy | patrick mchardy | 36 | 94.74% | 3 | 60.00% |
| pablo neira ayuso | pablo neira ayuso | 1 | 2.63% | 1 | 20.00% |
| stephen hemminger | stephen hemminger | 1 | 2.63% | 1 | 20.00% |
| Total | 38 | 100.00% | 5 | 100.00% |
EXPORT_SYMBOL_GPL(nf_register_afinfo);
void nf_unregister_afinfo(const struct nf_afinfo *afinfo)
{
mutex_lock(&afinfo_mutex);
RCU_INIT_POINTER(nf_afinfo[afinfo->family], NULL);
mutex_unlock(&afinfo_mutex);
synchronize_rcu();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| patrick mchardy | patrick mchardy | 37 | 97.37% | 3 | 75.00% |
| stephen hemminger | stephen hemminger | 1 | 2.63% | 1 | 25.00% |
| Total | 38 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL_GPL(nf_unregister_afinfo);
#ifdef HAVE_JUMP_LABEL
struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS];
EXPORT_SYMBOL(nf_hooks_needed);
#endif
static DEFINE_MUTEX(nf_hook_mutex);
#define nf_entry_dereference(e) \
rcu_dereference_protected(e, lockdep_is_held(&nf_hook_mutex))
static struct nf_hook_entry __rcu **nf_hook_entry_head(struct net *net, const struct nf_hook_ops *reg)
{
if (reg->pf != NFPROTO_NETDEV)
return net->nf.hooks[reg->pf]+reg->hooknum;
#ifdef CONFIG_NETFILTER_INGRESS
if (reg->hooknum == NF_NETDEV_INGRESS) {
if (reg->dev && dev_net(reg->dev) == net)
return ®->dev->nf_hooks_ingress;
}
#endif
return NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 39 | 45.35% | 2 | 25.00% |
| pablo neira ayuso | pablo neira ayuso | 23 | 26.74% | 2 | 25.00% |
| linus torvalds | linus torvalds | 13 | 15.12% | 1 | 12.50% |
| harald welte | harald welte | 7 | 8.14% | 1 | 12.50% |
| aaron conole | aaron conole | 4 | 4.65% | 2 | 25.00% |
| Total | 86 | 100.00% | 8 | 100.00% |
int nf_register_net_hook(struct net *net, const struct nf_hook_ops *reg)
{
struct nf_hook_entry __rcu **pp;
struct nf_hook_entry *entry, *p;
if (reg->pf == NFPROTO_NETDEV) {
#ifndef CONFIG_NETFILTER_INGRESS
if (reg->hooknum == NF_NETDEV_INGRESS)
return -EOPNOTSUPP;
#endif
if (reg->hooknum != NF_NETDEV_INGRESS ||
!reg->dev || dev_net(reg->dev) != net)
return -EINVAL;
}
pp = nf_hook_entry_head(net, reg);
if (!pp)
return -EINVAL;
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return -ENOMEM;
entry->orig_ops = reg;
entry->ops = *reg;
entry->next = NULL;
mutex_lock(&nf_hook_mutex);
/* Find the spot in the list */
while ((p = nf_entry_dereference(*pp)) != NULL) {
if (reg->priority < p->orig_ops->priority)
break;
pp = &p->next;
}
rcu_assign_pointer(entry->next, p);
rcu_assign_pointer(*pp, entry);
mutex_unlock(&nf_hook_mutex);
#ifdef CONFIG_NETFILTER_INGRESS
if (reg->pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS)
net_inc_ingress_queue();
#endif
#ifdef HAVE_JUMP_LABEL
static_key_slow_inc(&nf_hooks_needed[reg->pf][reg->hooknum]);
#endif
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| aaron conole | aaron conole | 83 | 32.55% | 3 | 20.00% |
| eric w. biederman | eric w. biederman | 71 | 27.84% | 4 | 26.67% |
| linus torvalds | linus torvalds | 47 | 18.43% | 1 | 6.67% |
| eric dumazet | eric dumazet | 17 | 6.67% | 1 | 6.67% |
| harald welte | harald welte | 17 | 6.67% | 1 | 6.67% |
| pablo neira ayuso | pablo neira ayuso | 14 | 5.49% | 2 | 13.33% |
| zhouyi zhou | zhouyi zhou | 3 | 1.18% | 1 | 6.67% |
| patrick mchardy | patrick mchardy | 2 | 0.78% | 1 | 6.67% |
| ingo molnar | ingo molnar | 1 | 0.39% | 1 | 6.67% |
| Total | 255 | 100.00% | 15 | 100.00% |
EXPORT_SYMBOL(nf_register_net_hook);
void nf_unregister_net_hook(struct net *net, const struct nf_hook_ops *reg)
{
struct nf_hook_entry __rcu **pp;
struct nf_hook_entry *p;
pp = nf_hook_entry_head(net, reg);
if (WARN_ON_ONCE(!pp))
return;
mutex_lock(&nf_hook_mutex);
while ((p = nf_entry_dereference(*pp)) != NULL) {
if (p->orig_ops == reg) {
rcu_assign_pointer(*pp, p->next);
break;
}
pp = &p->next;
}
mutex_unlock(&nf_hook_mutex);
if (!p) {
WARN(1, "nf_unregister_net_hook: hook not found!\n");
return;
}
#ifdef CONFIG_NETFILTER_INGRESS
if (reg->pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS)
net_dec_ingress_queue();
#endif
#ifdef HAVE_JUMP_LABEL
static_key_slow_dec(&nf_hooks_needed[reg->pf][reg->hooknum]);
#endif
synchronize_net();
nf_queue_nf_hook_drop(net, p);
/* other cpu might still process nfqueue verdict that used reg */
synchronize_net();
kfree(p);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 74 | 41.34% | 2 | 15.38% |
| linus torvalds | linus torvalds | 41 | 22.91% | 1 | 7.69% |
| pablo neira ayuso | pablo neira ayuso | 21 | 11.73% | 3 | 23.08% |
| harald welte | harald welte | 17 | 9.50% | 1 | 7.69% |
| aaron conole | aaron conole | 14 | 7.82% | 1 | 7.69% |
| florian westphal | florian westphal | 4 | 2.23% | 1 | 7.69% |
| zhouyi zhou | zhouyi zhou | 3 | 1.68% | 1 | 7.69% |
| eric dumazet | eric dumazet | 2 | 1.12% | 1 | 7.69% |
| patrick mchardy | patrick mchardy | 2 | 1.12% | 1 | 7.69% |
| ingo molnar | ingo molnar | 1 | 0.56% | 1 | 7.69% |
| Total | 179 | 100.00% | 13 | 100.00% |
EXPORT_SYMBOL(nf_unregister_net_hook);
int nf_register_net_hooks(struct net *net, const struct nf_hook_ops *reg,
unsigned int n)
{
unsigned int i;
int err = 0;
for (i = 0; i < n; i++) {
err = nf_register_net_hook(net, ®[i]);
if (err)
goto err;
}
return err;
err:
if (i > 0)
nf_unregister_net_hooks(net, reg, i);
return err;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 87 | 100.00% | 1 | 100.00% |
| Total | 87 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(nf_register_net_hooks);
void nf_unregister_net_hooks(struct net *net, const struct nf_hook_ops *reg,
unsigned int n)
{
while (n-- > 0)
nf_unregister_net_hook(net, ®[n]);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 38 | 100.00% | 1 | 100.00% |
| Total | 38 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(nf_unregister_net_hooks);
static LIST_HEAD(nf_hook_list);
static int _nf_register_hook(struct nf_hook_ops *reg)
{
struct net *net, *last;
int ret;
for_each_net(net) {
ret = nf_register_net_hook(net, reg);
if (ret && ret != -ENOENT)
goto rollback;
}
list_add_tail(®->list, &nf_hook_list);
return 0;
rollback:
last = net;
for_each_net(net) {
if (net == last)
break;
nf_unregister_net_hook(net, reg);
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 86 | 93.48% | 1 | 50.00% |
| mahesh bandewar | mahesh bandewar | 6 | 6.52% | 1 | 50.00% |
| Total | 92 | 100.00% | 2 | 100.00% |
int nf_register_hook(struct nf_hook_ops *reg)
{
int ret;
rtnl_lock();
ret = _nf_register_hook(reg);
rtnl_unlock();
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| mahesh bandewar | mahesh bandewar | 22 | 75.86% | 1 | 50.00% |
| eric w. biederman | eric w. biederman | 7 | 24.14% | 1 | 50.00% |
| Total | 29 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(nf_register_hook);
static void _nf_unregister_hook(struct nf_hook_ops *reg)
{
struct net *net;
list_del(®->list);
for_each_net(net)
nf_unregister_net_hook(net, reg);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 28 | 80.00% | 2 | 50.00% |
| eric dumazet | eric dumazet | 4 | 11.43% | 1 | 25.00% |
| mahesh bandewar | mahesh bandewar | 3 | 8.57% | 1 | 25.00% |
| Total | 35 | 100.00% | 4 | 100.00% |
void nf_unregister_hook(struct nf_hook_ops *reg)
{
rtnl_lock();
_nf_unregister_hook(reg);
rtnl_unlock();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| mahesh bandewar | mahesh bandewar | 17 | 80.95% | 1 | 33.33% |
| eric w. biederman | eric w. biederman | 3 | 14.29% | 1 | 33.33% |
| harald welte | harald welte | 1 | 4.76% | 1 | 33.33% |
| Total | 21 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(nf_unregister_hook);
int nf_register_hooks(struct nf_hook_ops *reg, unsigned int n)
{
unsigned int i;
int err = 0;
for (i = 0; i < n; i++) {
err = nf_register_hook(®[i]);
if (err)
goto err;
}
return err;
err:
if (i > 0)
nf_unregister_hooks(reg, i);
return err;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| patrick mchardy | patrick mchardy | 77 | 100.00% | 1 | 100.00% |
| Total | 77 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(nf_register_hooks);
/* Caller MUST take rtnl_lock() */
int _nf_register_hooks(struct nf_hook_ops *reg, unsigned int n)
{
unsigned int i;
int err = 0;
for (i = 0; i < n; i++) {
err = _nf_register_hook(®[i]);
if (err)
goto err;
}
return err;
err:
if (i > 0)
_nf_unregister_hooks(reg, i);
return err;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| mahesh bandewar | mahesh bandewar | 77 | 100.00% | 1 | 100.00% |
| Total | 77 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(_nf_register_hooks);
void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n)
{
while (n-- > 0)
nf_unregister_hook(®[n]);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| patrick mchardy | patrick mchardy | 23 | 76.67% | 1 | 50.00% |
| changli gao | changli gao | 7 | 23.33% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(nf_unregister_hooks);
/* Caller MUST take rtnl_lock */
void _nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n)
{
while (n-- > 0)
_nf_unregister_hook(®[n]);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| mahesh bandewar | mahesh bandewar | 30 | 100.00% | 1 | 100.00% |
| Total | 30 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(_nf_unregister_hooks);
unsigned int nf_iterate(struct sk_buff *skb,
struct nf_hook_state *state,
struct nf_hook_entry **entryp)
{
unsigned int verdict;
/*
* The caller must not block between calls to this
* function because of risk of continuing from deleted element.
*/
while (*entryp) {
if (state->thresh > (*entryp)->ops.priority) {
*entryp = rcu_dereference((*entryp)->next);
continue;
}
/* Optimization: we don't need to hold module
reference here, since function can't sleep. --RR */
repeat:
verdict = (*entryp)->ops.hook((*entryp)->ops.priv, skb, state);
if (verdict != NF_ACCEPT) {
#ifdef CONFIG_NETFILTER_DEBUG
if (unlikely((verdict & NF_VERDICT_MASK)
> NF_MAX_VERDICT)) {
NFDEBUG("Evil return from %p(%u).\n",
(*entryp)->ops.hook, state->hook);
*entryp = rcu_dereference((*entryp)->next);
continue;
}
#endif
if (verdict != NF_REPEAT)
return verdict;
goto repeat;
}
*entryp = rcu_dereference((*entryp)->next);
}
return NF_ACCEPT;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| harald welte | harald welte | 91 | 50.28% | 1 | 11.11% |
| aaron conole | aaron conole | 60 | 33.15% | 1 | 11.11% |
| michael wang | michael wang | 11 | 6.08% | 2 | 22.22% |
| david s. miller | david s. miller | 8 | 4.42% | 1 | 11.11% |
| patrick mchardy | patrick mchardy | 6 | 3.31% | 2 | 22.22% |
| eric w. biederman | eric w. biederman | 4 | 2.21% | 1 | 11.11% |
| hideaki yoshifuji | hideaki yoshifuji | 1 | 0.55% | 1 | 11.11% |
| Total | 181 | 100.00% | 9 | 100.00% |
/* Returns 1 if okfn() needs to be executed by the caller,
* -EPERM for NF_DROP, 0 otherwise. Caller must hold rcu_read_lock. */
int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state)
{
struct nf_hook_entry *entry;
unsigned int verdict;
int ret = 0;
entry = rcu_dereference(state->hook_entries);
next_hook:
verdict = nf_iterate(skb, state, &entry);
if (verdict == NF_ACCEPT || verdict == NF_STOP) {
ret = 1;
} else if ((verdict & NF_VERDICT_MASK) == NF_DROP) {
kfree_skb(skb);
ret = NF_DROP_GETERR(verdict);
if (ret == 0)
ret = -EPERM;
} else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) {
ret = nf_queue(skb, state, &entry, verdict);
if (ret == 1 && entry)
goto next_hook;
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| harald welte | harald welte | 92 | 63.45% | 1 | 10.00% |
| eric paris | eric paris | 15 | 10.34% | 1 | 10.00% |
| florian westphal | florian westphal | 11 | 7.59% | 3 | 30.00% |
| aaron conole | aaron conole | 8 | 5.52% | 1 | 10.00% |
| pablo neira ayuso | pablo neira ayuso | 7 | 4.83% | 1 | 10.00% |
| david s. miller | david s. miller | 6 | 4.14% | 1 | 10.00% |
| herbert xu | herbert xu | 4 | 2.76% | 1 | 10.00% |
| michael wang | michael wang | 2 | 1.38% | 1 | 10.00% |
| Total | 145 | 100.00% | 10 | 100.00% |
EXPORT_SYMBOL(nf_hook_slow);
int skb_make_writable(struct sk_buff *skb, unsigned int writable_len)
{
if (writable_len > skb->len)
return 0;
/* Not exclusive use of packet? Must copy. */
if (!skb_cloned(skb)) {
if (writable_len <= skb_headlen(skb))
return 1;
} else if (skb_clone_writable(skb, writable_len))
return 1;
if (writable_len <= skb_headlen(skb))
writable_len = 0;
else
writable_len -= skb_headlen(skb);
return !!__pskb_pull_tail(skb, writable_len);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| harald welte | harald welte | 47 | 51.09% | 1 | 33.33% |
| herbert xu | herbert xu | 39 | 42.39% | 1 | 33.33% |
| patrick mchardy | patrick mchardy | 6 | 6.52% | 1 | 33.33% |
| Total | 92 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(skb_make_writable);
/* This needs to be compiled in any case to avoid dependencies between the
* nfnetlink_queue code and nf_conntrack.
*/
struct nfnl_ct_hook __rcu *nfnl_ct_hook __read_mostly;
EXPORT_SYMBOL_GPL(nfnl_ct_hook);
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
/* This does not belong here, but locally generated errors need it if connection
tracking in use: without this, connection may not be in hash table, and hence
manufactured ICMP or RST packets will not be associated with it. */
void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *)
__rcu __read_mostly;
EXPORT_SYMBOL
(ip_ct_attach);
void nf_ct_attach(struct sk_buff *new, const struct sk_buff *skb)
{
void (*attach)(struct sk_buff *, const struct sk_buff *);
if (skb->nfct) {
rcu_read_lock();
attach = rcu_dereference(ip_ct_attach);
if (attach)
attach(new, skb);
rcu_read_unlock();
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| harald welte | harald welte | 47 | 73.44% | 1 | 33.33% |
| patrick mchardy | patrick mchardy | 17 | 26.56% | 2 | 66.67% |
| Total | 64 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(nf_ct_attach);
void (*nf_ct_destroy)(struct nf_conntrack *) __rcu __read_mostly;
EXPORT_SYMBOL
(nf_ct_destroy);
void nf_conntrack_destroy(struct nf_conntrack *nfct)
{
void (*destroy)(struct nf_conntrack *);
rcu_read_lock();
destroy = rcu_dereference(nf_ct_destroy);
BUG_ON(destroy == NULL);
destroy(nfct);
rcu_read_unlock();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| yasuyuki kozakai | yasuyuki kozakai | 46 | 100.00% | 1 | 100.00% |
| Total | 46 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(nf_conntrack_destroy);
/* Built-in default zone used e.g. by modules. */
const struct nf_conntrack_zone nf_ct_zone_dflt = {
.id = NF_CT_DEFAULT_ZONE_ID,
.dir = NF_CT_DEFAULT_ZONE_DIR,
};
EXPORT_SYMBOL_GPL(nf_ct_zone_dflt);
#endif /* CONFIG_NF_CONNTRACK */
#ifdef CONFIG_NF_NAT_NEEDED
void (*nf_nat_decode_session_hook)(struct sk_buff *, struct flowi *);
EXPORT_SYMBOL(nf_nat_decode_session_hook);
#endif
static int nf_register_hook_list(struct net *net)
{
struct nf_hook_ops *elem;
int ret;
rtnl_lock();
list_for_each_entry(elem, &nf_hook_list, list) {
ret = nf_register_net_hook(net, elem);
if (ret && ret != -ENOENT)
goto out_undo;
}
rtnl_unlock();
return 0;
out_undo:
list_for_each_entry_continue_reverse(elem, &nf_hook_list, list)
nf_unregister_net_hook(net, elem);
rtnl_unlock();
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 82 | 100.00% | 1 | 100.00% |
| Total | 82 | 100.00% | 1 | 100.00% |
static void nf_unregister_hook_list(struct net *net)
{
struct nf_hook_ops *elem;
rtnl_lock();
list_for_each_entry(elem, &nf_hook_list, list)
nf_unregister_net_hook(net, elem);
rtnl_unlock();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 37 | 100.00% | 1 | 100.00% |
| Total | 37 | 100.00% | 1 | 100.00% |
static int __net_init netfilter_net_init(struct net *net)
{
int i, h, ret;
for (i = 0; i < ARRAY_SIZE(net->nf.hooks); i++) {
for (h = 0; h < NF_MAX_HOOKS; h++)
RCU_INIT_POINTER(net->nf.hooks[i][h], NULL);
}
#ifdef CONFIG_PROC_FS
net->nf.proc_netfilter = proc_net_mkdir(net, "netfilter",
net->proc_net);
if (!net->nf.proc_netfilter) {
if (!net_eq(net, &init_net))
pr_err("cannot create netfilter proc entry");
return -ENOMEM;
}
#endif
ret = nf_register_hook_list(net);
if (ret)
remove_proc_entry("netfilter", net->proc_net);
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 77 | 52.38% | 1 | 25.00% |
| gao feng | gao feng | 60 | 40.82% | 1 | 25.00% |
| pablo neira ayuso | pablo neira ayuso | 7 | 4.76% | 1 | 25.00% |
| aaron conole | aaron conole | 3 | 2.04% | 1 | 25.00% |
| Total | 147 | 100.00% | 4 | 100.00% |
static void __net_exit netfilter_net_exit(struct net *net)
{
nf_unregister_hook_list(net);
remove_proc_entry("netfilter", net->proc_net);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| gao feng | gao feng | 21 | 80.77% | 1 | 50.00% |
| eric w. biederman | eric w. biederman | 5 | 19.23% | 1 | 50.00% |
| Total | 26 | 100.00% | 2 | 100.00% |
static struct pernet_operations netfilter_net_ops = {
.init = netfilter_net_init,
.exit = netfilter_net_exit,
};
int __init netfilter_init(void)
{
int ret;
ret = register_pernet_subsys(&netfilter_net_ops);
if (ret < 0)
goto err;
ret = netfilter_log_init();
if (ret < 0)
goto err_pernet;
return 0;
err_pernet:
unregister_pernet_subsys(&netfilter_net_ops);
err:
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| pablo neira ayuso | pablo neira ayuso | 32 | 55.17% | 1 | 33.33% |
| harald welte | harald welte | 19 | 32.76% | 1 | 33.33% |
| gao feng | gao feng | 7 | 12.07% | 1 | 33.33% |
| Total | 58 | 100.00% | 3 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
| eric w. biederman | eric w. biederman | 668 | 28.46% | 7 | 10.94% |
| harald welte | harald welte | 426 | 18.15% | 1 | 1.56% |
| patrick mchardy | patrick mchardy | 275 | 11.72% | 12 | 18.75% |
| aaron conole | aaron conole | 184 | 7.84% | 4 | 6.25% |
| mahesh bandewar | mahesh bandewar | 167 | 7.12% | 1 | 1.56% |
| pablo neira ayuso | pablo neira ayuso | 115 | 4.90% | 8 | 12.50% |
| gao feng | gao feng | 105 | 4.47% | 1 | 1.56% |
| linus torvalds | linus torvalds | 101 | 4.30% | 1 | 1.56% |
| yasuyuki kozakai | yasuyuki kozakai | 70 | 2.98% | 2 | 3.12% |
| eric dumazet | eric dumazet | 53 | 2.26% | 2 | 3.12% |
| florian westphal | florian westphal | 43 | 1.83% | 7 | 10.94% |
| herbert xu | herbert xu | 43 | 1.83% | 2 | 3.12% |
| daniel borkmann | daniel borkmann | 23 | 0.98% | 1 | 1.56% |
| eric paris | eric paris | 15 | 0.64% | 1 | 1.56% |
| david s. miller | david s. miller | 14 | 0.60% | 1 | 1.56% |
| michael wang | michael wang | 13 | 0.55% | 2 | 3.12% |
| zhouyi zhou | zhouyi zhou | 9 | 0.38% | 1 | 1.56% |
| changli gao | changli gao | 7 | 0.30% | 1 | 1.56% |
| tejun heo | tejun heo | 3 | 0.13% | 1 | 1.56% |
| ingo molnar | ingo molnar | 3 | 0.13% | 1 | 1.56% |
| ken-ichirou matsuzawa | ken-ichirou matsuzawa | 3 | 0.13% | 1 | 1.56% |
| stephen hemminger | stephen hemminger | 2 | 0.09% | 1 | 1.56% |
| martin josefsson | martin josefsson | 1 | 0.04% | 1 | 1.56% |
| hideaki yoshifuji | hideaki yoshifuji | 1 | 0.04% | 1 | 1.56% |
| jan engelhardt | jan engelhardt | 1 | 0.04% | 1 | 1.56% |
| arnd bergmann | arnd bergmann | 1 | 0.04% | 1 | 1.56% |
| igor maravic | igor maravic | 1 | 0.04% | 1 | 1.56% |
| Total | 2347 | 100.00% | 64 | 100.00% |