Release 4.7 net/bridge/netfilter/ebtable_broute.c
/*
* ebtable_broute
*
* Authors:
* Bart De Schuymer <bdschuym@pandora.be>
*
* April, 2002
*
* This table lets you choose between routing and bridging for frames
* entering on a bridge enslaved nic. This table is traversed before any
* other ebtables table. See net/bridge/br_input.c.
*/
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/module.h>
#include <linux/if_bridge.h>
/* EBT_ACCEPT means the frame will be bridged
* EBT_DROP means the frame will be routed
*/
static struct ebt_entries initial_chain = {
.name = "BROUTING",
.policy = EBT_ACCEPT,
};
static struct ebt_replace_kernel initial_table = {
.name = "broute",
.valid_hooks = 1 << NF_BR_BROUTING,
.entries_size = sizeof(struct ebt_entries),
.hook_entry = {
[NF_BR_BROUTING] = &initial_chain,
},
.entries = (char *)&initial_chain,
};
static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
{
if (valid_hooks & ~(1 << NF_BR_BROUTING))
return -EINVAL;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
bart de schuymer | bart de schuymer | 34 | 100.00% | 1 | 100.00% |
| Total | 34 | 100.00% | 1 | 100.00% |
static const struct ebt_table broute_table = {
.name = "broute",
.table = &initial_table,
.valid_hooks = 1 << NF_BR_BROUTING,
.check = check,
.me = THIS_MODULE,
};
static int ebt_broute(struct sk_buff *skb)
{
struct nf_hook_state state;
int ret;
nf_hook_state_init(&state, NULL, NF_BR_BROUTING, INT_MIN,
NFPROTO_BRIDGE, skb->dev, NULL, NULL,
dev_net(skb->dev), NULL);
ret = ebt_do_table(skb, &state, state.net->xt.broute_table);
if (ret == NF_DROP)
return 1; /* route it */
return 0; /* bridge it */
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
bart de schuymer | bart de schuymer | 39 | 48.15% | 2 | 40.00% |
eric w. biederman | eric w. biederman | 31 | 38.27% | 1 | 20.00% |
alexey dobriyan | alexey dobriyan | 9 | 11.11% | 1 | 20.00% |
herbert xu | herbert xu | 2 | 2.47% | 1 | 20.00% |
| Total | 81 | 100.00% | 5 | 100.00% |
static int __net_init broute_net_init(struct net *net)
{
net->xt.broute_table = ebt_register_table(net, &broute_table);
return PTR_ERR_OR_ZERO(net->xt.broute_table);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alexey dobriyan | alexey dobriyan | 24 | 66.67% | 3 | 60.00% |
bart de schuymer | bart de schuymer | 11 | 30.56% | 1 | 20.00% |
rusty russell | rusty russell | 1 | 2.78% | 1 | 20.00% |
| Total | 36 | 100.00% | 5 | 100.00% |
static void __net_exit broute_net_exit(struct net *net)
{
ebt_unregister_table(net, net->xt.broute_table);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alexey dobriyan | alexey dobriyan | 23 | 100.00% | 3 | 100.00% |
| Total | 23 | 100.00% | 3 | 100.00% |
static struct pernet_operations broute_net_ops = {
.init = broute_net_init,
.exit = broute_net_exit,
};
static int __init ebtable_broute_init(void)
{
int ret;
ret = register_pernet_subsys(&broute_net_ops);
if (ret < 0)
return ret;
/* see br_input.c */
RCU_INIT_POINTER(br_should_route_hook,
(br_should_route_hook_t *)ebt_broute);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
alexey dobriyan | alexey dobriyan | 28 | 63.64% | 2 | 28.57% |
bart de schuymer | bart de schuymer | 8 | 18.18% | 2 | 28.57% |
eric dumazet | eric dumazet | 4 | 9.09% | 1 | 14.29% |
pavel emelianov | pavel emelianov | 3 | 6.82% | 1 | 14.29% |
stephen hemminger | stephen hemminger | 1 | 2.27% | 1 | 14.29% |
| Total | 44 | 100.00% | 7 | 100.00% |
static void __exit ebtable_broute_fini(void)
{
RCU_INIT_POINTER(br_should_route_hook, NULL);
synchronize_net();
unregister_pernet_subsys(&broute_net_ops);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
bart de schuymer | bart de schuymer | 15 | 60.00% | 1 | 16.67% |
pavel emelianov | pavel emelianov | 3 | 12.00% | 1 | 16.67% |
alexey dobriyan | alexey dobriyan | 3 | 12.00% | 1 | 16.67% |
stephen hemminger | stephen hemminger | 3 | 12.00% | 2 | 33.33% |
andrew morton | andrew morton | 1 | 4.00% | 1 | 16.67% |
| Total | 25 | 100.00% | 6 | 100.00% |
module_init(ebtable_broute_init);
module_exit(ebtable_broute_fini);
MODULE_LICENSE("GPL");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
bart de schuymer | bart de schuymer | 194 | 49.87% | 3 | 16.67% |
alexey dobriyan | alexey dobriyan | 105 | 26.99% | 4 | 22.22% |
art haas | art haas | 37 | 9.51% | 1 | 5.56% |
eric w. biederman | eric w. biederman | 31 | 7.97% | 1 | 5.56% |
pavel emelianov | pavel emelianov | 6 | 1.54% | 1 | 5.56% |
eric dumazet | eric dumazet | 4 | 1.03% | 1 | 5.56% |
stephen hemminger | stephen hemminger | 4 | 1.03% | 2 | 11.11% |
andrew morton | andrew morton | 3 | 0.77% | 1 | 5.56% |
herbert xu | herbert xu | 2 | 0.51% | 1 | 5.56% |
al viro | al viro | 1 | 0.26% | 1 | 5.56% |
jan engelhardt | jan engelhardt | 1 | 0.26% | 1 | 5.56% |
rusty russell | rusty russell | 1 | 0.26% | 1 | 5.56% |
| Total | 389 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.