mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[NETFILTER]: x_tables: per-netns xt_tables
In fact all we want is per-netns set of rules, however doing that will unnecessary complicate routines such as ipt_hook()/ipt_do_table, so make full xt_table array per-netns. Every user stubbed with init_net for a while. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
a98da11d88
commit
8d87005207
7 changed files with 60 additions and 30 deletions
|
|
@ -1138,7 +1138,7 @@ static int get_info(void __user *user, int *len, int compat)
|
|||
if (compat)
|
||||
xt_compat_lock(AF_INET6);
|
||||
#endif
|
||||
t = try_then_request_module(xt_find_table_lock(AF_INET6, name),
|
||||
t = try_then_request_module(xt_find_table_lock(&init_net, AF_INET6, name),
|
||||
"ip6table_%s", name);
|
||||
if (t && !IS_ERR(t)) {
|
||||
struct ip6t_getinfo info;
|
||||
|
|
@ -1196,7 +1196,7 @@ get_entries(struct ip6t_get_entries __user *uptr, int *len)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
t = xt_find_table_lock(AF_INET6, get.name);
|
||||
t = xt_find_table_lock(&init_net, AF_INET6, get.name);
|
||||
if (t && !IS_ERR(t)) {
|
||||
struct xt_table_info *private = t->private;
|
||||
duprintf("t->private->number = %u\n", private->number);
|
||||
|
|
@ -1235,7 +1235,7 @@ __do_replace(const char *name, unsigned int valid_hooks,
|
|||
goto out;
|
||||
}
|
||||
|
||||
t = try_then_request_module(xt_find_table_lock(AF_INET6, name),
|
||||
t = try_then_request_module(xt_find_table_lock(&init_net, AF_INET6, name),
|
||||
"ip6table_%s", name);
|
||||
if (!t || IS_ERR(t)) {
|
||||
ret = t ? PTR_ERR(t) : -ENOENT;
|
||||
|
|
@ -1410,7 +1410,7 @@ do_add_counters(void __user *user, unsigned int len, int compat)
|
|||
goto free;
|
||||
}
|
||||
|
||||
t = xt_find_table_lock(AF_INET6, name);
|
||||
t = xt_find_table_lock(&init_net, AF_INET6, name);
|
||||
if (!t || IS_ERR(t)) {
|
||||
ret = t ? PTR_ERR(t) : -ENOENT;
|
||||
goto free;
|
||||
|
|
@ -1950,7 +1950,7 @@ compat_get_entries(struct compat_ip6t_get_entries __user *uptr, int *len)
|
|||
}
|
||||
|
||||
xt_compat_lock(AF_INET6);
|
||||
t = xt_find_table_lock(AF_INET6, get.name);
|
||||
t = xt_find_table_lock(&init_net, AF_INET6, get.name);
|
||||
if (t && !IS_ERR(t)) {
|
||||
struct xt_table_info *private = t->private;
|
||||
struct xt_table_info info;
|
||||
|
|
@ -2101,7 +2101,7 @@ int ip6t_register_table(struct xt_table *table, const struct ip6t_replace *repl)
|
|||
return ret;
|
||||
}
|
||||
|
||||
new_table = xt_register_table(table, &bootstrap, newinfo);
|
||||
new_table = xt_register_table(&init_net, table, &bootstrap, newinfo);
|
||||
if (IS_ERR(new_table)) {
|
||||
xt_free_table_info(newinfo);
|
||||
return PTR_ERR(new_table);
|
||||
|
|
|
|||
Loading…
Reference in a new issue