netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [iputils] Fix asymm messages.
@ 2007-04-03 18:20 John Heffner
  2007-04-03 18:20 ` [PATCH 2/2] [iputils] Re-probe at same TTL after MTU reduction John Heffner
  2007-04-09  4:16 ` [PATCH 1/2] [iputils] Fix asymm messages YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 2 replies; 4+ messages in thread
From: John Heffner @ 2007-04-03 18:20 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev, John Heffner

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] [iputils] Re-probe at same TTL after MTU reduction.
  2007-04-03 18:20 [PATCH 1/2] [iputils] Fix asymm messages John Heffner
@ 2007-04-03 18:20 ` John Heffner
  2007-04-09  4:17   ` YOSHIFUJI Hideaki / 吉藤英明
  2007-04-09  4:16 ` [PATCH 1/2] [iputils] Fix asymm messages YOSHIFUJI Hideaki / 吉藤英明
  1 sibling, 1 reply; 4+ messages in thread
From: John Heffner @ 2007-04-03 18:20 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev, John Heffner

This fixes a bug that would miss a hop after an ICMP packet too big message,
since it would continue increase the TTL without probing again.
---
 tracepath.c  |    6 ++++++
 tracepath6.c |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tracepath.c b/tracepath.c
index d035a1e..19b2c6b 100644
--- a/tracepath.c
+++ b/tracepath.c
@@ -352,8 +352,14 @@ main(int argc, char **argv)
 			exit(1);
 		}
 
+restart:
 		for (i=0; i<3; i++) {
+			int old_mtu;
+			
+			old_mtu = mtu;
 			res = probe_ttl(fd, ttl);
+			if (mtu != old_mtu)
+				goto restart;
 			if (res == 0)
 				goto done;
 			if (res > 0)
diff --git a/tracepath6.c b/tracepath6.c
index a010218..65c4a4a 100644
--- a/tracepath6.c
+++ b/tracepath6.c
@@ -422,8 +422,14 @@ int main(int argc, char **argv)
 			exit(1);
 		}
 
+restart:
 		for (i=0; i<3; i++) {
+			int old_mtu;
+			
+			old_mtu = mtu;
 			res = probe_ttl(fd, ttl);
+			if (mtu != old_mtu)
+				goto restart;
 			if (res == 0)
 				goto done;
 			if (res > 0)
-- 
1.5.0.2.gc260-dirty


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] [iputils] Fix asymm messages.
  2007-04-03 18:20 [PATCH 1/2] [iputils] Fix asymm messages John Heffner
  2007-04-03 18:20 ` [PATCH 2/2] [iputils] Re-probe at same TTL after MTU reduction John Heffner
@ 2007-04-09  4:16 ` YOSHIFUJI Hideaki / 吉藤英明
  1 sibling, 0 replies; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-04-09  4:16 UTC (permalink / raw)
  To: jheffner; +Cc: netdev, yoshfuji

In article <1175624435275-git-send-email-jheffner@psc.edu> (at Tue,  3 Apr 2007 14:20:34 -0400), John Heffner <jheffner@psc.edu> says:

> 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.

applied. thanks.

--yoshfuji

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] [iputils] Re-probe at same TTL after MTU reduction.
  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 / 吉藤英明
  0 siblings, 0 replies; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-04-09  4:17 UTC (permalink / raw)
  To: jheffner; +Cc: netdev, yoshfuji

In article <11756244353377-git-send-email-jheffner@psc.edu> (at Tue,  3 Apr 2007 14:20:35 -0400), John Heffner <jheffner@psc.edu> says:

> This fixes a bug that would miss a hop after an ICMP packet too big message,
> since it would continue increase the TTL without probing again.

Applied, thanks.

--yoshfuji

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-09  4:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-03 18:20 [PATCH 1/2] [iputils] Fix asymm messages John Heffner
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 / 吉藤英明

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).