netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: netdev@vger.kernel.org, Thomas Graf <tgraf@suug.ch>
Subject: Re: [PATCH net-next 04/13] ip_tunnels: add IPv6 addresses to ip_tunnel_key
Date: Wed, 19 Aug 2015 10:09:30 +0200	[thread overview]
Message-ID: <20150819100930.2dd9eb59@griffin> (raw)
In-Reply-To: <20150819003632.GA989@Alexeis-MacBook-Pro-2.local>

On Tue, 18 Aug 2015 17:36:32 -0700, Alexei Starovoitov wrote:
> please add commit message. +47 -32 cannot be empty.

The patch seemed rather trivial to me (it's basically "->key.ipv4_" to
"->keu.u.ipv4." conversion plus one new memset) but sure, I'll add a
few words.

It probably does not qualify as trivial if one can make a bug in it :-)

> > +/* Used to memset ipv4 address padding. */
> > +#define IP_TUNNEL_KEY_IPV4_PAD	offsetofend(struct ip_tunnel_key, u.ipv4.dst)
> > +#define IP_TUNNEL_KEY_IPV4_PAD_LEN				\
> > +	(FIELD_SIZEOF(struct ip_tunnel_key, u) - IP_TUNNEL_KEY_IPV4_PAD)
> > +
> >  struct ip_tunnel_key {
> >  	__be64			tun_id;
> > -	__be32			ipv4_src;
> > -	__be32			ipv4_dst;
> > +	union {
> > +		struct {
> > +			__be32	src;
> > +			__be32	dst;
> > +		} ipv4;
> > +		struct {
> > +			struct in6_addr src;
> > +			struct in6_addr dst;
> > +		} ipv6;
> > +	} u;
> ...
> > +	tun_info->key.u.ipv4.src = saddr;
> > +	tun_info->key.u.ipv4.dst = daddr;
> > +	memset((unsigned char *)&tun_info->key + IP_TUNNEL_KEY_IPV4_PAD,
> > +	       0, IP_TUNNEL_KEY_IPV4_PAD_LEN);
> 
> the math looks wrong.
> IP_TUNNEL_KEY_IPV4_PAD_LEN = sizeof(u) - offsetofend(u.ipv4.dst)
> 8 byte mistake?

Yes, thanks a lot for catching this.

 Jiri

-- 
Jiri Benc

  reply	other threads:[~2015-08-19  8:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 20:33 [PATCH net-next 00/13] lwtunnel: per route ipv6 support for vxlan Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 01/13] ip_tunnels: remove custom alignment and packing Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 02/13] ip_tunnels: use u8/u16/u32 Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 03/13] ip_tunnels: use offsetofend Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 04/13] ip_tunnels: add IPv6 addresses to ip_tunnel_key Jiri Benc
2015-08-19  0:36   ` Alexei Starovoitov
2015-08-19  8:09     ` Jiri Benc [this message]
2015-08-18 20:33 ` [PATCH net-next 05/13] ip_tunnels: use tos and ttl fields also for IPv6 Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 06/13] route: move lwtunnel state to dst_entry Jiri Benc
2015-08-19  6:51   ` roopa
2015-08-18 20:33 ` [PATCH net-next 07/13] ipv6: drop metadata dst in ip6_route_input Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 08/13] ipv6: ndisc: inherit metadata dst when creating ndisc requests Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 09/13] vxlan: provide access function for vxlan socket address family Jiri Benc
2015-08-25  0:34   ` Rustad, Mark D
2015-08-25 16:12     ` Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 10/13] vxlan: do not shadow flags variable Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 11/13] vxlan: metadata based tunneling for IPv6 Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 12/13] ipv6: route: extend flow representation with tunnel key Jiri Benc
2015-08-18 20:33 ` [PATCH net-next 13/13] ipv6: route: per route IP tunnel metadata via lightweight tunnel Jiri Benc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150819100930.2dd9eb59@griffin \
    --to=jbenc@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).