aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipvs/ip_vs_core.c
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2011-02-04 04:33:01 -0500
committerSimon Horman <horms@verge.net.au>2011-03-14 20:36:56 -0400
commit0cfa558e2c21644a0dd6c21cfadd8bbeaf9fe1a0 (patch)
tree9044f493ccffd4a440b943106e17fd8eafb1de33 /net/netfilter/ipvs/ip_vs_core.c
parent84b3cee39ff1ffc97f4f6fba8ad26786c1f6d8f5 (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/netfilter/ipvs/ip_vs_core.c')
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c11
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 1d8a2a22615..c9b83728f3c 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
610static 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
612static int sysctl_snat_reroute(struct sk_buff *skb) { return 0; } 618static int sysctl_snat_reroute(struct sk_buff *skb) { return 0; }
619static 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)) {