netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Heffner <jheffner@psc.edu>
To: yoshfuji@linux-ipv6.org
Cc: netdev@vger.kernel.org, John Heffner <jheffner@psc.edu>
Subject: [PATCH 1/2] [iputils] Fix asymm messages.
Date: Tue,  3 Apr 2007 14:20:34 -0400	[thread overview]
Message-ID: <1175624435275-git-send-email-jheffner@psc.edu> (raw)

We should only print the asymm messages in tracepath/6 when you receive a
TTL expired message, because this is the only time when we'd expect the
same number of hops back as our TTL was set to for a symmetric path.
---
 tracepath.c  |   25 ++++++++++++-------------
 tracepath6.c |   25 ++++++++++++-------------
 2 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/tracepath.c b/tracepath.c
index a562d88..d035a1e 100644
--- a/tracepath.c
+++ b/tracepath.c
@@ -163,19 +163,6 @@ restart:
 		}
 	}
 
-	if (rethops>=0) {
-		if (rethops<=64)
-			rethops = 65-rethops;
-		else if (rethops<=128)
-			rethops = 129-rethops;
-		else
-			rethops = 256-rethops;
-		if (sndhops>=0 && rethops != sndhops)
-			printf("asymm %2d ", rethops);
-		else if (sndhops<0 && rethops != ttl)
-			printf("asymm %2d ", rethops);
-	}
-
 	if (rettv) {
 		int diff = (tv.tv_sec-rettv->tv_sec)*1000000+(tv.tv_usec-rettv->tv_usec);
 		printf("%3d.%03dms ", diff/1000, diff%1000);
@@ -204,6 +191,18 @@ restart:
 		if (e->ee_origin == SO_EE_ORIGIN_ICMP &&
 		    e->ee_type == 11 &&
 		    e->ee_code == 0) {
+			if (rethops>=0) {
+				if (rethops<=64)
+					rethops = 65-rethops;
+				else if (rethops<=128)
+					rethops = 129-rethops;
+				else
+					rethops = 256-rethops;
+				if (sndhops>=0 && rethops != sndhops)
+					printf("asymm %2d ", rethops);
+				else if (sndhops<0 && rethops != ttl)
+					printf("asymm %2d ", rethops);
+			}
 			printf("\n");
 			break;
 		}
diff --git a/tracepath6.c b/tracepath6.c
index 6f13a51..a010218 100644
--- a/tracepath6.c
+++ b/tracepath6.c
@@ -176,19 +176,6 @@ restart:
 		}
 	}
 
-	if (rethops>=0) {
-		if (rethops<=64)
-			rethops = 65-rethops;
-		else if (rethops<=128)
-			rethops = 129-rethops;
-		else
-			rethops = 256-rethops;
-		if (sndhops>=0 && rethops != sndhops)
-			printf("asymm %2d ", rethops);
-		else if (sndhops<0 && rethops != ttl)
-			printf("asymm %2d ", rethops);
-	}
-
 	if (rettv) {
 		int diff = (tv.tv_sec-rettv->tv_sec)*1000000+(tv.tv_usec-rettv->tv_usec);
 		printf("%3d.%03dms ", diff/1000, diff%1000);
@@ -220,6 +207,18 @@ restart:
 		    (e->ee_origin == SO_EE_ORIGIN_ICMP6 &&
 		     e->ee_type == 3 &&
 		     e->ee_code == 0)) {
+			if (rethops>=0) {
+				if (rethops<=64)
+					rethops = 65-rethops;
+				else if (rethops<=128)
+					rethops = 129-rethops;
+				else
+					rethops = 256-rethops;
+				if (sndhops>=0 && rethops != sndhops)
+					printf("asymm %2d ", rethops);
+				else if (sndhops<0 && rethops != ttl)
+					printf("asymm %2d ", rethops);
+			}
 			printf("\n");
 			break;
 		}
-- 
1.5.0.2.gc260-dirty


             reply	other threads:[~2007-04-03 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03 18:20 John Heffner [this message]
2007-04-03 18:20 ` [PATCH 2/2] [iputils] Re-probe at same TTL after MTU reduction John Heffner
2007-04-09  4:17   ` YOSHIFUJI Hideaki / 吉藤英明
2007-04-09  4:16 ` [PATCH 1/2] [iputils] Fix asymm messages YOSHIFUJI Hideaki / 吉藤英明

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=1175624435275-git-send-email-jheffner@psc.edu \
    --to=jheffner@psc.edu \
    --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).