[ovs-dev] [PATCH net-next v2 3/4] ip_tunnels: introduce ip6_tunnel_key_init

Jiri Benc jbenc at redhat.com
Fri Oct 2 05:58:45 UTC 2015


On Thu, 1 Oct 2015 17:11:43 -0700, Pravin Shelar wrote:
> On Thu, Oct 1, 2015 at 7:44 AM, Jiri Benc <jbenc at redhat.com> wrote:
> > +static inline void ip_tunnel_key_init(struct ip_tunnel_key *key,
> > +                                     __be32 saddr, __be32 daddr,
> > +                                     u8 tos, u8 ttl,
> > +                                     __be16 tp_src, __be16 tp_dst,
> > +                                     __be64 tun_id, __be16 tun_flags)
> > +{
> > +       __ip_tunnel_key_init(key, tos, ttl, tp_src, tp_dst, tun_id,
> > +                            tun_flags);
> > +       key->u.ipv4.src = saddr;
> > +       key->u.ipv4.dst = daddr;
> > +       memset((unsigned char *)key + IP_TUNNEL_KEY_IPV4_PAD,
> > +              0, IP_TUNNEL_KEY_IPV4_PAD_LEN);
> neat: since IP_TUNNEL_KEY_IPV4_PAD not really IPv4 tunnel key padding
> anymore, This also needs to be renamed.

It is IPv4 address padding. It is used to zero out the part of the
union of IPv6 and IPv4 addresses that is not occupied by IPv4
addresses. The name was just too long to include "ADDR", too.

The original pad constant was renamed to IP_TUNNEL_KEY_SIZE, thus is
not referencing IPv4 anymore.

> otherwise looks good.
> 
> Acked-by: Pravin B Shelar <pshelar at nicira.com>

Thanks,

 Jiri

-- 
Jiri Benc



More information about the dev mailing list