lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 23 Feb 2020 21:44:47 +0530
From:   Martin Varghese <martinvarghesenokia@...il.com>
To:     Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc:     Network Development <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>,
        Jonathan Corbet <corbet@....net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        scott.drennan@...ia.com, Jiri Benc <jbenc@...hat.com>,
        martin.varghese@...ia.com
Subject: Re: [PATCH net-next v7 1/2] net: UDP tunnel encapsulation module for
 tunnelling different protocols like MPLS,IP,NSH etc.

On Sun, Feb 16, 2020 at 09:16:34PM -0800, Willem de Bruijn wrote:
> > > There are also a couple of reverse christmas tree violations.
> > >
> > In Bareudp.c correct?
> 
> Right. Like bareudp_udp_encap_recv.
> 
> > Wondering if there is any flag in checkpatch to catch them?
> 
> It has come up, but I don't believe anything is merged.
> 
> > > > +struct rtable *ip_route_output_tunnel(struct sk_buff *skb,
> > > > +                                     struct net_device *dev,
> > > > +                                     struct net *net, __be32 *saddr,
> > > > +                                     const struct ip_tunnel_info *info,
> > > > +                                     u8 protocol, bool use_cache)
> > > > +{
> > > > +#ifdef CONFIG_DST_CACHE
> > > > +       struct dst_cache *dst_cache;
> > > > +#endif
> > > > +       struct rtable *rt = NULL;
> > > > +       struct flowi4 fl4;
> > > > +       __u8 tos;
> > > > +
> > > > +       memset(&fl4, 0, sizeof(fl4));
> > > > +       fl4.flowi4_mark = skb->mark;
> > > > +       fl4.flowi4_proto = protocol;
> > > > +       fl4.daddr = info->key.u.ipv4.dst;
> > > > +       fl4.saddr = info->key.u.ipv4.src;
> > > > +
> > > > +       tos = info->key.tos;
> > > > +       fl4.flowi4_tos = RT_TOS(tos);
> > > > +#ifdef CONFIG_DST_CACHE
> > > > +       dst_cache = (struct dst_cache *)&info->dst_cache;
> > > > +       if (use_cache) {
> > > > +               rt = dst_cache_get_ip4(dst_cache, saddr);
> > > > +               if (rt)
> > > > +                       return rt;
> > > > +       }
> > > > +#endif
> > >
> > > This is the same in geneve, but no need to initialize fl4 on a cache
> > > hit. Then can also be restructured to only have a single #ifdef block.
> > Yes , We need not initialize fl4 when cache is used.
> > But i didnt get your point on restructuing to have a single #ifdef block
> > Could you please give more details
> 
> Actually, I was mistaken, missing the third #ifdef block that calls
> dst_cache_set_ip[46]. But the type of info->dst_cache is struct
> dst_cache, so I don't think the explicit cast or additional pointer
> variable (and with that the first #ifdef) is needed. But it's clearly
> not terribly important.
I tried to remove the additional pointer variable and the explicit cast.But Compiler warns as 
the info is a const variable (same for geneve)

So shall we keep as it is ?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ