LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH net-next 2/3] ipvs: add function to find tunnels

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: [PATCH net-next 2/3] ipvs: add function to find tunnels
Cc: lvs-devel@xxxxxxxxxxxxxxx, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxxxx, Jacky Hu <hengqing.hu@xxxxxxxxx>, jacky.hu@xxxxxxxxxxx, jason.niesz@xxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 4 Apr 2019 12:13:18 +0200
On Wed, Apr 03, 2019 at 11:52:37PM +0300, Julian Anastasov wrote:
> 
>       Hello,
> 
> On Wed, 3 Apr 2019, Simon Horman wrote:
> 
> > On Sun, Mar 31, 2019 at 01:26:20PM +0300, Julian Anastasov wrote:
> > 
> > > diff --git a/net/netfilter/ipvs/ip_vs_core.c 
> > > b/net/netfilter/ipvs/ip_vs_core.c
> > > index 14457551bcb4..4447ee512b88 100644
> > > --- a/net/netfilter/ipvs/ip_vs_core.c
> > > +++ b/net/netfilter/ipvs/ip_vs_core.c
> > > @@ -1598,6 +1598,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct 
> > > sk_buff *skb, int *related,
> > >   struct ip_vs_proto_data *pd;
> > >   unsigned int offset, offset2, ihl, verdict;
> > >   bool ipip, new_cp = false;
> > > + union nf_inet_addr *raddr;
> > >  
> > >   *related = 1;
> > >  
> > > @@ -1636,15 +1637,22 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct 
> > > sk_buff *skb, int *related,
> > >   cih = skb_header_pointer(skb, offset, sizeof(_ciph), &_ciph);
> > >   if (cih == NULL)
> > >           return NF_ACCEPT; /* The packet looks wrong, ignore */
> > > + raddr = (union nf_inet_addr *)&cih->daddr;
> > 
> > Hi Julian,
> > 
> >     Could we consider the following instead of casting?
> > 
> >     union nf_inet_addr raddr;
> > 
> >     ...
> > 
> >     raddr.ip = cih->daddr;
> 
>       It was my initial option but then I decided to reduce the
> stack usage

Understood, I guess that minimising stack usage wins.

> 
> Regards
> 
> --
> Julian Anastasov <ja@xxxxxx>
> 

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