diff options
| author | David S. Miller <davem@davemloft.net> | 2012-08-22 21:48:21 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-08-22 21:48:52 -0400 |
| commit | bf277b0ccea7d2422b85e232017ce3fddbe9c49c (patch) | |
| tree | 252232255b8a6024eccf2fea668bb89de5ae3073 | |
| parent | bba6ec7e4963e30366359686f34e5bdb00b1a066 (diff) | |
| parent | 90efbed18a30d78145419cdbd44f9ec152efeb16 (diff) | |
Merge git://1984.lsi.us.es/nf-next
Pablo Neira Ayuso says:
====================
This is the first batch of Netfilter and IPVS updates for your
net-next tree. Mostly cleanups for the Netfilter side. They are:
* Remove unnecessary RTNL locking now that we have support
for namespace in nf_conntrack, from Patrick McHardy.
* Cleanup to eliminate unnecessary goto in the initialization
path of several Netfilter tables, from Jean Sacren.
* Another cleanup from Wu Fengguang, this time to PTR_RET instead
of if IS_ERR then return PTR_ERR.
* Use list_for_each_entry_continue_rcu in nf_iterate, from
Michael Wang.
* Add pmtu_disc sysctl option to disable PMTU in their tunneling
transmitter, from Julian Anastasov.
* Generalize application protocol registration in IPVS and modify
IPVS FTP helper to use it, from Julian Anastasov.
* update Kconfig. The IPVS FTP helper depends on the Netfilter FTP
helper for NAT support, from Julian Anastasov.
* Add logic to update PMTU for IPIP packets in IPVS, again
from Julian Anastasov.
* A couple of sparse warning fixes for IPVS and Netfilter from
Claudiu Ghioc and Patrick McHardy respectively.
Patrick's IPv6 NAT changes will follow after this batch, I need
to flush this batch first before refreshing my tree.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
23 files changed, 232 insertions, 132 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 95374d1696a1..ee75ccdf5188 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -808,8 +808,6 @@ struct netns_ipvs { | |||
| 808 | struct list_head rs_table[IP_VS_RTAB_SIZE]; | 808 | struct list_head rs_table[IP_VS_RTAB_SIZE]; |
| 809 | /* ip_vs_app */ | 809 | /* ip_vs_app */ |
| 810 | struct list_head app_list; | 810 | struct list_head app_list; |
| 811 | /* ip_vs_ftp */ | ||
| 812 | struct ip_vs_app *ftp_app; | ||
| 813 | /* ip_vs_proto */ | 811 | /* ip_vs_proto */ |
| 814 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ | 812 | #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */ |
| 815 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; | 813 | struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE]; |
| @@ -890,6 +888,7 @@ struct netns_ipvs { | |||
| 890 | unsigned int sysctl_sync_refresh_period; | 888 | unsigned int sysctl_sync_refresh_period; |
| 891 | int sysctl_sync_retries; | 889 | int sysctl_sync_retries; |
| 892 | int sysctl_nat_icmp_send; | 890 | int sysctl_nat_icmp_send; |
| 891 | int sysctl_pmtu_disc; | ||
| 893 | 892 | ||
| 894 | /* ip_vs_lblc */ | 893 | /* ip_vs_lblc */ |
| 895 | int sysctl_lblc_expiration; | 894 | int sysctl_lblc_expiration; |
| @@ -976,6 +975,11 @@ static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | |||
| 976 | return ipvs->sysctl_sync_sock_size; | 975 | return ipvs->sysctl_sync_sock_size; |
| 977 | } | 976 | } |
| 978 | 977 | ||
| 978 | static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | ||
| 979 | { | ||
| 980 | return ipvs->sysctl_pmtu_disc; | ||
| 981 | } | ||
| 982 | |||
| 979 | #else | 983 | #else |
| 980 | 984 | ||
| 981 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) | 985 | static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) |
| @@ -1018,6 +1022,11 @@ static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) | |||
| 1018 | return 0; | 1022 | return 0; |
| 1019 | } | 1023 | } |
| 1020 | 1024 | ||
| 1025 | static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) | ||
| 1026 | { | ||
| 1027 | return 1; | ||
| 1028 | } | ||
| 1029 | |||
| 1021 | #endif | 1030 | #endif |
| 1022 | 1031 | ||
| 1023 | /* | 1032 | /* |
| @@ -1179,7 +1188,8 @@ extern void ip_vs_service_net_cleanup(struct net *net); | |||
| 1179 | * (from ip_vs_app.c) | 1188 | * (from ip_vs_app.c) |
| 1180 | */ | 1189 | */ |
| 1181 | #define IP_VS_APP_MAX_PORTS 8 | 1190 | #define IP_VS_APP_MAX_PORTS 8 |
| 1182 | extern int register_ip_vs_app(struct net *net, struct ip_vs_app *app); | 1191 | extern struct ip_vs_app *register_ip_vs_app(struct net *net, |
| 1192 | struct ip_vs_app *app); | ||
| 1183 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); | 1193 | extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); |
| 1184 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1194 | extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); |
| 1185 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); | 1195 | extern void ip_vs_unbind_app(struct ip_vs_conn *cp); |
diff --git a/net/bridge/netfilter/ebtable_filter.c b/net/bridge/netfilter/ebtable_filter.c index 42e6bd094574..3c2e9dced9e0 100644 --- a/net/bridge/netfilter/ebtable_filter.c +++ b/net/bridge/netfilter/ebtable_filter.c | |||
| @@ -100,9 +100,7 @@ static struct nf_hook_ops ebt_ops_filter[] __read_mostly = { | |||
| 100 | static int __net_init frame_filter_net_init(struct net *net) | 100 | static int __net_init frame_filter_net_init(struct net *net) |
| 101 | { | 101 | { |
| 102 | net->xt.frame_filter = ebt_register_table(net, &frame_filter); | 102 | net->xt.frame_filter = ebt_register_table(net, &frame_filter); |
| 103 | if (IS_ERR(net->xt.frame_filter)) | 103 | return PTR_RET(net->xt.frame_filter); |
| 104 | return PTR_ERR(net->xt.frame_filter); | ||
| 105 | return 0; | ||
| 106 | } | 104 | } |
| 107 | 105 | ||
| 108 | static void __net_exit frame_filter_net_exit(struct net *net) | 106 | static void __net_exit frame_filter_net_exit(struct net *net) |
diff --git a/net/bridge/netfilter/ebtable_nat.c b/net/bridge/netfilter/ebtable_nat.c index 6dc2f878ae05..10871bc77908 100644 --- a/net/bridge/netfilter/ebtable_nat.c +++ b/net/bridge/netfilter/ebtable_nat.c | |||
| @@ -100,9 +100,7 @@ static struct nf_hook_ops ebt_ops_nat[] __read_mostly = { | |||
| 100 | static int __net_init frame_nat_net_init(struct net *net) | 100 | static int __net_init frame_nat_net_init(struct net *net) |
| 101 | { | 101 | { |
| 102 | net->xt.frame_nat = ebt_register_table(net, &frame_nat); | 102 | net->xt.frame_nat = ebt_register_table(net, &frame_nat); |
| 103 | if (IS_ERR(net->xt.frame_nat)) | 103 | return PTR_RET(net->xt.frame_nat); |
| 104 | return PTR_ERR(net->xt.frame_nat); | ||
| 105 | return 0; | ||
| 106 | } | 104 | } |
| 107 | 105 | ||
| 108 | static void __net_exit frame_nat_net_exit(struct net *net) | 106 | static void __net_exit frame_nat_net_exit(struct net *net) |
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c index 851acec852d2..6b3da5cf54e9 100644 --- a/net/ipv4/netfilter/iptable_filter.c +++ b/net/ipv4/netfilter/iptable_filter.c | |||
| @@ -69,9 +69,7 @@ static int __net_init iptable_filter_net_init(struct net *net) | |||
| 69 | net->ipv4.iptable_filter = | 69 | net->ipv4.iptable_filter = |
| 70 | ipt_register_table(net, &packet_filter, repl); | 70 | ipt_register_table(net, &packet_filter, repl); |
| 71 | kfree(repl); | 71 | kfree(repl); |
| 72 | if (IS_ERR(net->ipv4.iptable_filter)) | 72 | return PTR_RET(net->ipv4.iptable_filter); |
| 73 | return PTR_ERR(net->ipv4.iptable_filter); | ||
| 74 | return 0; | ||
| 75 | } | 73 | } |
| 76 | 74 | ||
| 77 | static void __net_exit iptable_filter_net_exit(struct net *net) | 75 | static void __net_exit iptable_filter_net_exit(struct net *net) |
| @@ -96,14 +94,10 @@ static int __init iptable_filter_init(void) | |||
| 96 | filter_ops = xt_hook_link(&packet_filter, iptable_filter_hook); | 94 | filter_ops = xt_hook_link(&packet_filter, iptable_filter_hook); |
| 97 | if (IS_ERR(filter_ops)) { | 95 | if (IS_ERR(filter_ops)) { |
| 98 | ret = PTR_ERR(filter_ops); | 96 | ret = PTR_ERR(filter_ops); |
| 99 | goto cleanup_table; | 97 | unregister_pernet_subsys(&iptable_filter_net_ops); |
| 100 | } | 98 | } |
| 101 | 99 | ||
| 102 | return ret; | 100 | return ret; |
| 103 | |||
| 104 | cleanup_table: | ||
| 105 | unregister_pernet_subsys(&iptable_filter_net_ops); | ||
| 106 | return ret; | ||
| 107 | } | 101 | } |
| 108 | 102 | ||
| 109 | static void __exit iptable_filter_fini(void) | 103 | static void __exit iptable_filter_fini(void) |
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c index aef5d1fbe77d..85d88f206447 100644 --- a/net/ipv4/netfilter/iptable_mangle.c +++ b/net/ipv4/netfilter/iptable_mangle.c | |||
| @@ -104,9 +104,7 @@ static int __net_init iptable_mangle_net_init(struct net *net) | |||
| 104 | net->ipv4.iptable_mangle = | 104 | net->ipv4.iptable_mangle = |
| 105 | ipt_register_table(net, &packet_mangler, repl); | 105 | ipt_register_table(net, &packet_mangler, repl); |
| 106 | kfree(repl); | 106 | kfree(repl); |
| 107 | if (IS_ERR(net->ipv4.iptable_mangle)) | 107 | return PTR_RET(net->ipv4.iptable_mangle); |
| 108 | return PTR_ERR(net->ipv4.iptable_mangle); | ||
| 109 | return 0; | ||
| 110 | } | 108 | } |
| 111 | 109 | ||
| 112 | static void __net_exit iptable_mangle_net_exit(struct net *net) | 110 | static void __net_exit iptable_mangle_net_exit(struct net *net) |
| @@ -131,14 +129,10 @@ static int __init iptable_mangle_init(void) | |||
| 131 | mangle_ops = xt_hook_link(&packet_mangler, iptable_mangle_hook); | 129 | mangle_ops = xt_hook_link(&packet_mangler, iptable_mangle_hook); |
| 132 | if (IS_ERR(mangle_ops)) { | 130 | if (IS_ERR(mangle_ops)) { |
| 133 | ret = PTR_ERR(mangle_ops); | ||
