LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] ipvs: Remove possibly unused net variable from ip_vs_out

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [PATCH] ipvs: Remove possibly unused net variable from ip_vs_out
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, Wensong Zhang <wensong@xxxxxxxxxxxx>, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
From: Julian Anastasov <ja@xxxxxx>
Date: Tue, 6 Oct 2015 21:24:09 +0300 (EEST)
        Hello,

On Tue, 6 Oct 2015, Simon Horman wrote:

> Since 6f2bcea9917d ("ipvs: Pass ipvs into ip_vs_in_icmp and
> ip_vs_in_icmp_v6") the net variable in ip_vs_out() appears to be unused
> unless CONFIG_IP_VS_IPV6 is set. To resolve this remove the net variable
> and dereference net asneeded.
> 
> Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

        Both patches look good to me

Acked-by: Julian Anastasov <ja@xxxxxx>

> ---
>  net/netfilter/ipvs/ip_vs_core.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index d08df435c2aa..3773154d9b71 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1172,7 +1172,6 @@ drop:
>  static unsigned int
>  ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff 
> *skb, int af)
>  {
> -     struct net *net = ipvs->net;
>       struct ip_vs_iphdr iph;
>       struct ip_vs_protocol *pp;
>       struct ip_vs_proto_data *pd;
> @@ -1272,7 +1271,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int 
> hooknum, struct sk_buff *skb, in
>  #ifdef CONFIG_IP_VS_IPV6
>                               if (af == AF_INET6) {
>                                       if (!skb->dev)
> -                                             skb->dev = net->loopback_dev;
> +                                             skb->dev = 
> ipvs->net->loopback_dev;
>                                       icmpv6_send(skb,
>                                                   ICMPV6_DEST_UNREACH,
>                                                   ICMPV6_PORT_UNREACH,
> -- 
> 2.1.4

Regards

--
Julian Anastasov <ja@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>