Commit 1be21320 authored by Art Haas's avatar Art Haas Committed by David S. Miller

[NETFILTER]: C99 initializers for ipv6 netfilter.

parent d64a850d
...@@ -81,9 +81,13 @@ static struct ...@@ -81,9 +81,13 @@ static struct
} }
}; };
static struct ip6t_table packet_filter static struct ip6t_table packet_filter = {
= { { NULL, NULL }, "filter", &initial_table.repl, .name = "filter",
FILTER_VALID_HOOKS, RW_LOCK_UNLOCKED, NULL, THIS_MODULE }; .table = &initial_table.repl,
.valid_hooks = FILTER_VALID_HOOKS,
.lock = RW_LOCK_UNLOCKED,
.me = THIS_MODULE,
};
/* The work comes in here from netfilter.c. */ /* The work comes in here from netfilter.c. */
static unsigned int static unsigned int
...@@ -116,11 +120,25 @@ ip6t_local_out_hook(unsigned int hook, ...@@ -116,11 +120,25 @@ ip6t_local_out_hook(unsigned int hook,
return ip6t_do_table(pskb, hook, in, out, &packet_filter, NULL); return ip6t_do_table(pskb, hook, in, out, &packet_filter, NULL);
} }
static struct nf_hook_ops ip6t_ops[] static struct nf_hook_ops ip6t_ops[] = {
= { { { NULL, NULL }, ip6t_hook, PF_INET6, NF_IP6_LOCAL_IN, NF_IP6_PRI_FILTER }, {
{ { NULL, NULL }, ip6t_hook, PF_INET6, NF_IP6_FORWARD, NF_IP6_PRI_FILTER }, .hook = ip6t_hook,
{ { NULL, NULL }, ip6t_local_out_hook, PF_INET6, NF_IP6_LOCAL_OUT, .pf = PF_INET6,
NF_IP6_PRI_FILTER } .hooknum = NF_IP6_LOCAL_IN,
.priority = NF_IP6_PRI_FILTER,
},
{
.hook = ip6t_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_FORWARD,
.priority = NF_IP6_PRI_FILTER,
},
{
.hook = ip6t_local_out_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_LOCAL_OUT,
.priority = NF_IP6_PRI_FILTER,
},
}; };
/* Default to forward because I got too much mail already. */ /* Default to forward because I got too much mail already. */
......
...@@ -111,9 +111,13 @@ static struct ...@@ -111,9 +111,13 @@ static struct
} }
}; };
static struct ip6t_table packet_mangler static struct ip6t_table packet_mangler = {
= { { NULL, NULL }, "mangle", &initial_table.repl, .name = "mangle",
MANGLE_VALID_HOOKS, RW_LOCK_UNLOCKED, NULL, THIS_MODULE }; .table = &initial_table.repl,
.valid_hooks = MANGLE_VALID_HOOKS,
.lock = RW_LOCK_UNLOCKED,
.me = THIS_MODULE,
};
/* The work comes in here from netfilter.c. */ /* The work comes in here from netfilter.c. */
static unsigned int static unsigned int
...@@ -175,12 +179,37 @@ ip6t_local_hook(unsigned int hook, ...@@ -175,12 +179,37 @@ ip6t_local_hook(unsigned int hook,
return ret; return ret;
} }
static struct nf_hook_ops ip6t_ops[] static struct nf_hook_ops ip6t_ops[] = {
= { { { NULL, NULL }, ip6t_route_hook, PF_INET6, NF_IP6_PRE_ROUTING, NF_IP6_PRI_MANGLE }, {
{ { NULL, NULL }, ip6t_local_hook, PF_INET6, NF_IP6_LOCAL_IN, NF_IP6_PRI_MANGLE }, .hook = ip6t_route_hook,
{ { NULL, NULL }, ip6t_route_hook, PF_INET6, NF_IP6_FORWARD, NF_IP6_PRI_MANGLE }, .pf = PF_INET6,
{ { NULL, NULL }, ip6t_local_hook, PF_INET6, NF_IP6_LOCAL_OUT, NF_IP6_PRI_MANGLE }, .hooknum = NF_IP6_PRE_ROUTING,
{ { NULL, NULL }, ip6t_route_hook, PF_INET6, NF_IP6_POST_ROUTING, NF_IP6_PRI_MANGLE } .priority = NF_IP6_PRI_MANGLE,
},
{
.hook = ip6t_local_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_LOCAL_IN,
.priority = NF_IP6_PRI_MANGLE,
},
{
.hook = ip6t_route_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_FORWARD,
.priority = NF_IP6_PRI_MANGLE,
},
{
.hook = ip6t_local_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_LOCAL_OUT,
.priority = NF_IP6_PRI_MANGLE,
},
{
.hook = ip6t_route_hook,
.pf = PF_INET6,
.hooknum = NF_IP6_POST_ROUTING,
.priority = NF_IP6_PRI_MANGLE,
},
}; };
static int __init init(void) static int __init init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment