From: Alexei Starovoitov <alexei.starovoitov@gmail•com>
To: Jiri Benc <jbenc@redhat•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: Tue, 18 Aug 2015 17:36:32 -0700 [thread overview]
Message-ID: <20150819003632.GA989@Alexeis-MacBook-Pro-2.local> (raw)
In-Reply-To: <199ae8362eabd65661ab145e9bfc281c5f5470ad.1439929916.git.jbenc@redhat.com>
On Tue, Aug 18, 2015 at 10:33:13PM +0200, Jiri Benc wrote:
> Signed-off-by: Jiri Benc <jbenc@redhat•com>
> ---
> drivers/net/vxlan.c | 6 +++---
> include/net/ip_tunnels.h | 23 +++++++++++++++++++----
> net/core/filter.c | 4 ++--
> net/ipv4/ip_gre.c | 10 +++++-----
> net/ipv4/ip_tunnel_core.c | 8 ++++----
> net/openvswitch/flow_netlink.c | 18 +++++++++---------
> net/openvswitch/flow_table.c | 2 +-
> net/openvswitch/vport-geneve.c | 2 +-
> net/openvswitch/vport.c | 2 +-
> net/openvswitch/vport.h | 4 ++--
> 10 files changed, 47 insertions(+), 32 deletions(-)
please add commit message. +47 -32 cannot be empty.
> +/* 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?
next prev parent reply other threads:[~2015-08-19 0:36 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 [this message]
2015-08-19 8:09 ` Jiri Benc
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=20150819003632.GA989@Alexeis-MacBook-Pro-2.local \
--to=alexei.starovoitov@gmail$(echo .)com \
--cc=jbenc@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=tgraf@suug$(echo .)ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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