Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215505
b: refs/heads/master
c: f5a4184
h: refs/heads/master
i:
  215503: f63b76f
v: v3
  • Loading branch information
Julian Anastasov authored and Simon Horman committed Oct 21, 2010
1 parent 471bbc8 commit 55b635e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ca5bb5450aa2401fa272efeb741ebb260d0fbb0
refs/heads/master: f5a41847acc535e2e2018e397b1876ba7577d9d9
41 changes: 21 additions & 20 deletions trunk/net/netfilter/ipvs/ip_vs_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,17 @@ static int handle_response_icmp(int af, struct sk_buff *skb,
#endif
ip_vs_nat_icmp(skb, pp, cp, 1);

#ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) {
if (sysctl_ip_vs_snat_reroute && ip6_route_me_harder(skb) != 0)
goto out;
} else
#endif
if ((sysctl_ip_vs_snat_reroute ||
skb_rtable(skb)->rt_flags & RTCF_LOCAL) &&
ip_route_me_harder(skb, RTN_LOCAL) != 0)
goto out;

/* do the statistics and put it back */
ip_vs_out_stats(cp, skb);

Expand Down Expand Up @@ -940,16 +951,16 @@ handle_response(int af, struct sk_buff *skb, struct ip_vs_protocol *pp,
* if it came from this machine itself. So re-compute
* the routing information.
*/
if (sysctl_ip_vs_snat_reroute) {
#ifdef CONFIG_IP_VS_IPV6
if (af == AF_INET6) {
if (ip6_route_me_harder(skb) != 0)
goto drop;
} else
if (af == AF_INET6) {
if (sysctl_ip_vs_snat_reroute && ip6_route_me_harder(skb) != 0)
goto drop;
} else
#endif
if (ip_route_me_harder(skb, RTN_LOCAL) != 0)
goto drop;
}
if ((sysctl_ip_vs_snat_reroute ||
skb_rtable(skb)->rt_flags & RTCF_LOCAL) &&
ip_route_me_harder(skb, RTN_LOCAL) != 0)
goto drop;

IP_VS_DBG_PKT(10, pp, skb, 0, "After SNAT");

Expand Down Expand Up @@ -1001,13 +1012,8 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb,
int verdict = ip_vs_out_icmp_v6(skb, &related,
hooknum);

if (related) {
if (sysctl_ip_vs_snat_reroute &&
NF_ACCEPT == verdict &&
ip6_route_me_harder(skb))
verdict = NF_DROP;
if (related)
return verdict;
}
ip_vs_fill_iphdr(af, skb_network_header(skb), &iph);
}
} else
Expand All @@ -1016,13 +1022,8 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb,
int related;
int verdict = ip_vs_out_icmp(skb, &related, hooknum);

if (related) {
if (sysctl_ip_vs_snat_reroute &&
NF_ACCEPT == verdict &&
ip_route_me_harder(skb, RTN_LOCAL))
verdict = NF_DROP;
if (related)
return verdict;
}
ip_vs_fill_iphdr(af, skb_network_header(skb), &iph);
}

Expand Down

0 comments on commit 55b635e

Please sign in to comment.