diff mbox series

ipv6: icmp: Updating pmtu for link local route

Message ID 52d524fe-5bc9-4c10-5ef1-9cae7ddb41ba@cisco.com
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series ipv6: icmp: Updating pmtu for link local route | expand

Commit Message

Georg Kohmann (geokohma) July 6, 2018, 12:59 p.m. UTC
When a ICMPV6_PKT_TOOBIG is received from a link local address the pmtu 
will be updated on a route with an arbitrary interface index. Subsequent 
packets sent back to the same link local address may therefore end up 
not considering the updated pmtu.

Current behavior breaks TAHI v6LC4.1.4 Reduce PMTU On-link.
Referring to RFC 1981: Section 3:
"Note that Path MTU Discovery must be performed even in cases where a 
node "thinks" a destination is attached to the same link as itself. In a 
situation such as when a neighboring router acts as proxy [ND] for some 
destination, the destination can to appear to be directly connected but 
is in fact more than one hop away."

Using the interface index from the incoming ICMPV6_PKT_TOOBIG when 
updating the pmtu.

Signed-off-by: Georg Kohmann <geokohma@cisco.com>
---
  net/ipv6/icmp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

         else if (type == NDISC_REDIRECT)
                 ip6_redirect(skb, net, skb->dev->ifindex, 0,
                              sock_net_uid(net, NULL));
---

Tested on kernel 4.4.38.
I am however worried that this patch may have consequences for other 
traffic on the same interface. Please advice or suggest at better approach.

Comments

David Miller July 7, 2018, 12:14 p.m. UTC | #1
From: Georg Kohmann <geokohma@cisco.com>
Date: Fri, 6 Jul 2018 14:59:56 +0200

> @@ -92,7 +92,7 @@ static void icmpv6_err(struct sk_buff *skb, struct
> inet6_skb_parm *opt,
>         struct net *net = dev_net(skb->dev);
> 
>         if (type == ICMPV6_PKT_TOOBIG)
> -               ip6_update_pmtu(skb, net, info, 0, 0, sock_net_uid(net,
> -NULL));
> +               ip6_update_pmtu(skb, net, info, skb->dev->ifindex, 0,

This patch is pretty seriously mangled by your email client.

Fix this, then email a test patch to yourself.

Do not repost this patch to the mailing list until you can
successfully apply the patch you receive in your test email.

Thank you.
diff mbox series

Patch

diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index be491bf..7d0e9c7 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -92,7 +92,7 @@  static void icmpv6_err(struct sk_buff *skb, struct 
inet6_skb_parm *opt,
         struct net *net = dev_net(skb->dev);

         if (type == ICMPV6_PKT_TOOBIG)
-               ip6_update_pmtu(skb, net, info, 0, 0, sock_net_uid(net, 
NULL));
+               ip6_update_pmtu(skb, net, info, skb->dev->ifindex, 0, 
sock_net_uid(net, NULL));