Commit 7b5f689a2c25fbae66683071e895e444658b0eef

Authored by Eric W. Biederman
Committed by Simon Horman
1 parent 6f2bcea991

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: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>

Showing 1 changed file with 7 additions and 8 deletions Side-by-side Diff

net/netfilter/ipvs/ip_vs_core.c
... ... @@ -897,10 +897,9 @@
897 897 * Find any that might be relevant, check against existing connections.
898 898 * Currently handles error types - unreachable, quench, ttl exceeded.
899 899 */
900   -static int ip_vs_out_icmp(struct sk_buff *skb, int *related,
901   - unsigned int hooknum)
  900 +static int ip_vs_out_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb,
  901 + int *related, unsigned int hooknum)
902 902 {
903   - struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
904 903 struct iphdr *iph;
905 904 struct icmphdr _icmph, *ic;
906 905 struct iphdr _ciph, *cih; /* The ip header contained within the ICMP */
907 906  
... ... @@ -973,10 +972,10 @@
973 972 }
974 973  
975 974 #ifdef CONFIG_IP_VS_IPV6
976   -static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related,
977   - unsigned int hooknum, struct ip_vs_iphdr *ipvsh)
  975 +static int ip_vs_out_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
  976 + int *related, unsigned int hooknum,
  977 + struct ip_vs_iphdr *ipvsh)
978 978 {
979   - struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
980 979 struct icmp6hdr _icmph, *ic;
981 980 struct ip_vs_iphdr ciph = {.flags = 0, .fragoffs = 0};/*Contained IP */
982 981 struct ip_vs_conn *cp;
... ... @@ -1208,7 +1207,7 @@
1208 1207 if (af == AF_INET6) {
1209 1208 if (unlikely(iph.protocol == IPPROTO_ICMPV6)) {
1210 1209 int related;
1211   - int verdict = ip_vs_out_icmp_v6(skb, &related,
  1210 + int verdict = ip_vs_out_icmp_v6(ipvs, skb, &related,
1212 1211 hooknum, &iph);
1213 1212  
1214 1213 if (related)
... ... @@ -1218,7 +1217,7 @@
1218 1217 #endif
1219 1218 if (unlikely(iph.protocol == IPPROTO_ICMP)) {
1220 1219 int related;
1221   - int verdict = ip_vs_out_icmp(skb, &related, hooknum);
  1220 + int verdict = ip_vs_out_icmp(ipvs, skb, &related, hooknum);
1222 1221  
1223 1222 if (related)
1224 1223 return verdict;