From: Ahmed Abdelsalam <amsalam20@gmail.com>
To: davem@davemloft.net, dlebrun@google.com, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, amsalam20@gmail.com
Subject: [net-next] ipv6:sr: Use the right next-hop value for neighbor discovery in End.DX4
Date: Sat, 25 Aug 2018 16:15:41 +0200 [thread overview]
Message-ID: <20180825141541.960-1-amsalam20@gmail.com> (raw)
The SRv6 End.DX4 behaviour supports the use-case of L3VPN,
where a FIB lookup in a specific tenant table at the egress
PE is not required [1].
In the implementation of the behaviour, after the packet being
decapsulated, the lookup in the routing sub-system is done based
on next-hop specified form the control plane (using iproute2) or
the destination address of the packet.
However, the neighbour discovery process always fall back on the
destination address of the packet (in ip_finish_output2 ()),
if "rt_gateway" value is not present in the "struct rtable rt".
nexthop = (__force u32) rt_nexthop(rt, ip_hdr(skb)->daddr);
This patch makes sure that "rt_gateway" has the value of
the next-hop configured from the control plane.
The patch is tested for inner IPv4 packets having destination
address different from the next-hop configured using iproute2
[1] https://tools.ietf.org/html/draft-filsfils-spring-srv6-network-programming-05
Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>
---
net/ipv6/seg6_local.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 60325dbfe88b..d346f0d19c09 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -374,6 +374,8 @@ static int input_action_end_dx4(struct sk_buff *skb,
if (err)
goto drop;
+ ((struct rtable *)skb_dst(skb))->rt_gateway = nhaddr;
+
return dst_input(skb);
drop:
--
2.11.0
next reply other threads:[~2018-08-25 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-25 14:15 Ahmed Abdelsalam [this message]
2018-09-01 0:46 ` [net-next] ipv6:sr: Use the right next-hop value for neighbor discovery in End.DX4 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=20180825141541.960-1-amsalam20@gmail.com \
--to=amsalam20@gmail.com \
--cc=davem@davemloft.net \
--cc=dlebrun@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).