From: Vadim Fedorenko <vfedorenko@novek.ru>
To: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Vadim Fedorenko <vfedorenko@novek.ru>
Subject: [net-next v2 2/5] ip6_tunnel: add MPLS transmit support
Date: Wed, 20 May 2020 18:21:36 +0300 [thread overview]
Message-ID: <1589988099-13095-3-git-send-email-vfedorenko@novek.ru> (raw)
In-Reply-To: <1589988099-13095-1-git-send-email-vfedorenko@novek.ru>
Add ETH_P_MPLS_UC as supported protocol.
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
---
net/ipv6/ip6_tunnel.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index dae6f71..6b94c87 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1232,6 +1232,8 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
ipv6_push_frag_opts(skb, &opt.ops, &proto);
}
+ skb_set_inner_ipproto(skb, proto);
+
skb_push(skb, sizeof(struct ipv6hdr));
skb_reset_network_header(skb);
ipv6h = ipv6_hdr(skb);
@@ -1348,6 +1350,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
fl6.flowlabel |= ip6_flowlabel(ipv6h);
break;
default:
+ orig_dsfield = dsfield = ip6_tclass(t->parms.flowinfo);
break;
}
}
@@ -1358,8 +1361,6 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
- skb_set_inner_ipproto(skb, protocol);
-
err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu,
protocol);
if (err != 0) {
@@ -1402,6 +1403,9 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
goto tx_err;
ipproto = IPPROTO_IPV6;
break;
+ case htons(ETH_P_MPLS_UC):
+ ipproto = IPPROTO_MPLS;
+ break;
default:
goto tx_err;
}
--
1.8.3.1
next prev parent reply other threads:[~2020-05-20 15:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 15:21 [net-next v2 0/5] ip6_tunnel: add MPLS support Vadim Fedorenko
2020-05-20 15:21 ` [net-next v2 1/5] ip6_tunnel: simplify transmit path Vadim Fedorenko
2020-05-20 15:21 ` Vadim Fedorenko [this message]
2020-05-20 15:21 ` [net-next v2 3/5] tunnel6: support for IPPROTO_MPLS Vadim Fedorenko
2020-05-20 15:21 ` [net-next v2 4/5] ip6_tunnel: add generic MPLS receive support Vadim Fedorenko
2020-05-20 15:21 ` [net-next v2 5/5] mpls: Add support for IPv6 tunnels Vadim Fedorenko
2020-05-22 22:49 ` [net-next v2 0/5] ip6_tunnel: add MPLS support 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=1589988099-13095-3-git-send-email-vfedorenko@novek.ru \
--to=vfedorenko@novek.ru \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/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).