diff options
author | Simon Horman <horms@verge.net.au> | 2011-02-04 04:33:01 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-14 20:36:56 -0400 |
commit | 0cfa558e2c21644a0dd6c21cfadd8bbeaf9fe1a0 (patch) | |
tree | 9044f493ccffd4a440b943106e17fd8eafb1de33 /net | |
parent | 84b3cee39ff1ffc97f4f6fba8ad26786c1f6d8f5 (diff) |
IPVS: Add sysctl_nat_icmp_send()
In preparation for not including sysctl_nat_icmp_send in
struct netns_ipvs when CONFIG_SYCTL is not defined.
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 1d8a2a226151..c9b83728f3ce 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -607,9 +607,16 @@ static int sysctl_snat_reroute(struct sk_buff *skb) | |||
607 | return ipvs->sysctl_snat_reroute; | 607 | return ipvs->sysctl_snat_reroute; |
608 | } | 608 | } |
609 | 609 | ||
610 | static int sysctl_nat_icmp_send(struct net *net) | ||
611 | { | ||
612 | struct netns_ipvs *ipvs = net_ipvs(net); | ||
613 | return ipvs->sysctl_nat_icmp_send; | ||
614 | } | ||
615 | |||
610 | #else | 616 | #else |
611 | 617 | ||
612 | static int sysctl_snat_reroute(struct sk_buff *skb) { return 0; } | 618 | static int sysctl_snat_reroute(struct sk_buff *skb) { return 0; } |
619 | static int sysctl_nat_icmp_send(struct net *net) { return 0; } | ||
613 | 620 | ||
614 | #endif | 621 | #endif |
615 | 622 | ||
@@ -1074,7 +1081,6 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1074 | struct ip_vs_protocol *pp; | 1081 | struct ip_vs_protocol *pp; |
1075 | struct ip_vs_proto_data *pd; | 1082 | struct ip_vs_proto_data *pd; |
1076 | struct ip_vs_conn *cp; | 1083 | struct ip_vs_conn *cp; |
1077 | struct netns_ipvs *ipvs; | ||
1078 | 1084 | ||
1079 | EnterFunction(11); | 1085 | EnterFunction(11); |
1080 | 1086 | ||
@@ -1149,11 +1155,10 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af) | |||
1149 | * Check if the packet belongs to an existing entry | 1155 | * Check if the packet belongs to an existing entry |
1150 | */ | 1156 | */ |
1151 | cp = pp->conn_out_get(af, skb, &iph, iph.len, 0); | 1157 | cp = pp->conn_out_get(af, skb, &iph, iph.len, 0); |
1152 | ipvs = net_ipvs(net); | ||
1153 | 1158 | ||
1154 | if (likely(cp)) | 1159 | if (likely(cp)) |
1155 | return handle_response(af, skb, pd, cp, iph.len); | 1160 | return handle_response(af, skb, pd, cp, iph.len); |
1156 | if (ipvs->sysctl_nat_icmp_send && | 1161 | if (sysctl_nat_icmp_send(net) && |
1157 | (pp->protocol == IPPROTO_TCP || | 1162 | (pp->protocol == IPPROTO_TCP || |
1158 | pp->protocol == IPPROTO_UDP || | 1163 | pp->protocol == IPPROTO_UDP || |
1159 | pp->protocol == IPPROTO_SCTP)) { | 1164 | pp->protocol == IPPROTO_SCTP)) { |