netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Fix bug of update IPv4 PMTU when received ICMP Fragmentation Needed message
Date: Mon, 04 Jun 2007 08:39:21 +0800	[thread overview]
Message-ID: <46635F39.2090009@cn.fujitsu.com> (raw)
In-Reply-To: <E1HuRAd-0002Wl-00@gondolin.me.apana.org.au>


>> When received ICMP Fragmentation Needed message, PATH MTU is always set 
>> to the 576 even if MTU in ICMP message is lager then 576. This is 
>> because of error condition in function ip_rt_frag_needed(), now if 
>> packet size of that ICMP message is less then new MTU, packet size will 
>> be used ,but RFC says ICMP error message return as much as we can 
>> without exceeding 576 bytes.
>>
>> This patch has Fixed this BUG.
>>
>>     
>
> Huh? The test new_mtu >= old_mtu should only hold if the sending router
> is buggy which is what the hack is for.
>
> Cheers,
>   
Note here old_mtu is not the real old mtu, is the received message's size:
  unsigned short old_mtu = ntohs(iph->tot_len);
So maybe the patch would like following.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

--- net/ipv4/route.c.orig	2007-05-25 05:22:47.000000000 +0800
+++ net/ipv4/route.c	2007-06-04 08:31:36.000000000 +0800
@@ -1424,7 +1424,7 @@ unsigned short ip_rt_frag_needed(struct 
 			    !(dst_metric_locked(&rth->u.dst, RTAX_MTU))) {
 				unsigned short mtu = new_mtu;
 
-				if (new_mtu < 68 || new_mtu >= old_mtu) {
+				if (new_mtu < 68 || new_mtu >= rth->u.dst.metrics[RTAX_MTU-1]) {
 
 					/* BSD 4.2 compatibility hack :-( */
 					if (mtu == 0 &&



  reply	other threads:[~2007-06-04  0:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-01  3:51 [PATCH] Fix bug of update IPv4 PMTU when received ICMP Fragmentation Needed message Wei Yongjun
2007-06-02 10:49 ` Herbert Xu
2007-06-04  0:39   ` Wei Yongjun [this message]
2007-06-04  2:55     ` Herbert Xu
2007-06-04  4:03       ` Wei Yongjun
2007-06-04  4:14         ` Herbert Xu
2007-06-04  4:32           ` Wei Yongjun
2007-06-04  4:55             ` Herbert Xu
2007-06-04  5:38               ` Wei Yongjun
2012-03-21 11:40                 ` Ranjeeth

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=46635F39.2090009@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=herbert@gondor.apana.org.au \
    --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).