Commit 7b5f689a authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Simon Horman

ipvs: Pass ipvs into ip_vs_out_icmp and ip_vs_out_icmp_v6

This removes the need to compute ipvs with the hack "net_ipvs(skb_net(skb))"
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
parent 6f2bcea9
...@@ -897,10 +897,9 @@ static int handle_response_icmp(int af, struct sk_buff *skb, ...@@ -897,10 +897,9 @@ static int handle_response_icmp(int af, struct sk_buff *skb,
* Find any that might be relevant, check against existing connections. * Find any that might be relevant, check against existing connections.
* Currently handles error types - unreachable, quench, ttl exceeded. * Currently handles error types - unreachable, quench, ttl exceeded.
*/ */
static int ip_vs_out_icmp(struct sk_buff *skb, int *related, static int ip_vs_out_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb,
unsigned int hooknum) int *related, unsigned int hooknum)
{ {
struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
struct iphdr *iph; struct iphdr *iph;
struct icmphdr _icmph, *ic; struct icmphdr _icmph, *ic;
struct iphdr _ciph, *cih; /* The ip header contained within the ICMP */ struct iphdr _ciph, *cih; /* The ip header contained within the ICMP */
...@@ -973,10 +972,10 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related, ...@@ -973,10 +972,10 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related,
} }
#ifdef CONFIG_IP_VS_IPV6 #ifdef CONFIG_IP_VS_IPV6
static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related, static int ip_vs_out_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
unsigned int hooknum, struct ip_vs_iphdr *ipvsh) int *related, unsigned int hooknum,
struct ip_vs_iphdr *ipvsh)
{ {
struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
struct icmp6hdr _icmph, *ic; struct icmp6hdr _icmph, *ic;
struct ip_vs_iphdr ciph = {.flags = 0, .fragoffs = 0};/*Contained IP */ struct ip_vs_iphdr ciph = {.flags = 0, .fragoffs = 0};/*Contained IP */
struct ip_vs_conn *cp; struct ip_vs_conn *cp;
...@@ -1208,7 +1207,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in ...@@ -1208,7 +1207,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
if (af == AF_INET6) { if (af == AF_INET6) {
if (unlikely(iph.protocol == IPPROTO_ICMPV6)) { if (unlikely(iph.protocol == IPPROTO_ICMPV6)) {
int related; int related;
int verdict = ip_vs_out_icmp_v6(skb, &related, int verdict = ip_vs_out_icmp_v6(ipvs, skb, &related,
hooknum, &iph); hooknum, &iph);
if (related) if (related)
...@@ -1218,7 +1217,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in ...@@ -1218,7 +1217,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
#endif #endif
if (unlikely(iph.protocol == IPPROTO_ICMP)) { if (unlikely(iph.protocol == IPPROTO_ICMP)) {
int related; int related;
int verdict = ip_vs_out_icmp(skb, &related, hooknum); int verdict = ip_vs_out_icmp(ipvs, skb, &related, hooknum);
if (related) if (related)
return verdict; return verdict;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment