From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
To: Eli Cooper <elicooper@gmx.com>, Tom Herbert <tom@herbertland.com>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] ipv6: Don't unset flowi6_proto in ipxip6_tnl_xmit()
Date: Fri, 26 Aug 2016 22:49:23 +0300 [thread overview]
Message-ID: <20160826224923.62827d04@halley> (raw)
In-Reply-To: <20160826155229.8040-1-elicooper@gmx.com>
Hi,
On Fri, 26 Aug 2016 23:52:29 +0800 Eli Cooper <elicooper@gmx.com> wrote:
> Commit 8eb30be0352d0916 ("ipv6: Create ip6_tnl_xmit") unsets
> flowi6_proto in ip4ip6_tnl_xmit() and ip6ip6_tnl_xmit().
> Since xfrm_selector_match() relies on this info, IPv6 packets
> sent by an ip6tunnel cannot be properly selected by their
> protocols after removing it. This patch puts flowi6_proto back.
>
> Cc: stable@vger.kernel.org
> Fixes: 8eb30be0352d ("ipv6: Create ip6_tnl_xmit")
> Signed-off-by: Eli Cooper <elicooper@gmx.com>
> ---
> net/ipv6/ip6_tunnel.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
> index 2050217..5c57797 100644
> --- a/net/ipv6/ip6_tunnel.c
> +++ b/net/ipv6/ip6_tunnel.c
> @@ -1174,6 +1174,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
> encap_limit = t->parms.encap_limit;
>
> memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
> + fl6.flowi6_proto = IPPROTO_IPIP;
>
> dsfield = ipv4_get_dsfield(iph);
>
> @@ -1233,6 +1234,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
> encap_limit = t->parms.encap_limit;
>
> memcpy(&fl6, &t->fl.u.ip6, sizeof(fl6));
> + fl6.flowi6_proto = IPPROTO_IPV6;
>
I wonder if this is the right way to go.
This DOES fix the regression for ip4ip6_tnl_xmit and ip6ip6_tnl_xmit
users.
However new users of 'ip6_tnl_xmit' (e.g. __gre6_xmit callers) may still
have their 'fl6->flowi6_proto' not armed.
Maybe the right fix is assigning 'fl6->flowi6_proto = proto', either at
start of 'ip6_tnl_xmit' or just prior the ip6_route_output() call.
Tom, can you acknowledge?
Thanks,
Shmulik
next prev parent reply other threads:[~2016-08-26 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 15:52 [PATCH] ipv6: Don't unset flowi6_proto in ipxip6_tnl_xmit() Eli Cooper
2016-08-26 19:49 ` Shmulik Ladkani [this message]
2016-08-27 1:09 ` Eli Cooper
2016-08-31 20:56 ` David Miller
2016-09-01 1:18 ` Eli Cooper
2016-09-02 6:41 ` David Miller
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=20160826224923.62827d04@halley \
--to=shmulik.ladkani@gmail.com \
--cc=davem@davemloft.net \
--cc=elicooper@gmx.com \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
/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).