netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: weiwan@google.com
Cc: edumazet@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH] ipv6: Fix the pmtu path for connected UDP socket
Date: Wed, 16 Mar 2016 19:53:41 -0400 (EDT)	[thread overview]
Message-ID: <20160316.195341.68257764618999441.davem@davemloft.net> (raw)
In-Reply-To: <1457989187-92851-1-git-send-email-tracywwnj@gmail.com>

From: Wei Wang <weiwan@google.com>
Date: Mon, 14 Mar 2016 13:59:47 -0700

> From: Wei Wang <weiwan@google.com>
> 
> When ICMPV6_PKT_TOOBIG message is received by a connected UDP socket,
> the new mtu value is not properly updated in the dst_entry associated
> with the socket.
> This leads to the issue that the mtu value returned by getsockopt(sockfd,
> IPPROTO_IPV6, IPV6_MTU, ...) is wrong.
> The fix is to update sk->sk_dst_cache and other corresponding fields
> when a new routing cache is allocated for the new pmtu in UDP connected
> socket case.
> 
> Signed-off-by: Wei Wang <weiwan@google.com>

Wait a second:

>  		if (nrt6) {
>  			rt6_do_update_pmtu(nrt6, mtu);
> -
> -			/* ip6_ins_rt(nrt6) will bump the
> -			 * rt6->rt6i_node->fn_sernum
> -			 * which will fail the next rt6_check() and
> -			 * invalidate the sk->sk_dst_cache.
> -			 */
> +			if (sk)
> +				ip6_dst_store(sk, &nrt6->dst, daddr, saddr);
>  			ip6_ins_rt(nrt6);
>  		}
>  	}

I still haven't seen a satisfactory answer as to why the as-designed
invalidation mechanism using fn_sernum is not working.

If that's broken, then a lot of other things won't work properly
either.

I've read the ip6_ins_rt() code path several times, and it always
increments the serial number, and therefore the next dst->check() call
(which every cached route usage should invoke) should invalide
this socket's route and lookup the new one.

Why does this not work?

  reply	other threads:[~2016-03-16 23:53 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14 20:59 [PATCH] ipv6: Fix the pmtu path for connected UDP socket Wei Wang
2016-03-16 23:53 ` David Miller [this message]
2016-03-17  0:22   ` Eric Dumazet
2016-03-17  2:38     ` David Miller
2016-03-17  3:34       ` Eric Dumazet
2016-03-18 17:19         ` Cong Wang
     [not found]           ` <CAEA6p_CfDYYLf-s0pUy7VNFH+46PDZSXNzUExXRAM_xv2w8tcw@mail.gmail.com>
2016-03-18 18:10             ` Cong Wang
2016-03-18 21:26               ` Wei Wang
2016-03-18 22:09                 ` Cong Wang
2016-03-21 17:13                   ` Wei Wang
2016-03-22  6:02                     ` Martin KaFai Lau
2016-03-22 16:53                       ` Cong Wang
2016-03-22 17:39                         ` Martin KaFai Lau
2016-03-22 18:03                           ` Wei Wang
2016-03-22 18:16                             ` Martin KaFai Lau
2016-03-22 20:13                             ` Cong Wang
2016-03-22 23:36                               ` Eric Dumazet
2016-03-23 23:57                                 ` Wei Wang
2016-03-24 18:32                                   ` Martin KaFai Lau
2016-03-24 19:45                                     ` Martin KaFai Lau
2016-03-25 23:55                                   ` Martin KaFai Lau
2016-03-26  0:16                                     ` Martin KaFai Lau
2016-03-28 22:39                                       ` Cong Wang
2016-03-28 23:44                                         ` Martin KaFai Lau
2016-03-24 19:23                                 ` Cong Wang
2016-03-22 18:19                           ` Cong Wang
2016-03-18  7:17 ` Martin KaFai Lau
  -- strict thread matches above, loose matches on Subject: below --
2016-03-02 19:19 Wei Wang
2016-03-06  5:55 ` David Miller
2016-03-07 17:19   ` Eric Dumazet
2016-03-07 17:35     ` Eric Dumazet
2016-03-07 21:28 ` Martin KaFai Lau

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=20160316.195341.68257764618999441.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=weiwan@google.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).