AW: [En-Nut-Discussion] patch to make traceroute work properly
Oliver Schulz
olischulz at web.de
Thu May 26 13:34:53 CEST 2005
Hi Dave,
Because the TCP protocol stack answers with a RST segment to an incoming
packet with no reachable port, it's a good idea to do the same for incoming
UDP packets. And you are right to use the ICMP protocol and I see no
difficulties in your path. I will apply your path to the cvs HEAD asap.
Chers,
Oliver.
-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Dave
Gesendet: Donnerstag, 26. Mai 2005 13:06
An: Ethernut User Chat (English)
Betreff: [En-Nut-Discussion] patch to make traceroute work properly
Hi everyone,
I found this bug, by trying to use 'traceroute' to contact my ethernut
board. I never got a response from the ethernut board. This may make
troubleshooting network problems tricky, so I decided to try to fix it.
And it appears that my patch works without any ill effects. Of course I used
a network protocol analyzer (Ethereal) to check out everything, before and
after my patch, and I compared it to a working system.
I would think this patch would be included in the official version, if I
didn't screw up anything. Please look it over, and let me know.
-Dave
diff -ru old/net/udpin.c new/net/udpin.c
--- old/net/udpin.c 2005-02-02 19:04:32.000000000 -0500
+++ new/net/udpin.c 2005-05-26 06:13:30.870850008 -0400
@@ -113,6 +113,8 @@
#include <sys/event.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp.h>
#include <netinet/udp.h>
#include <sys/socket.h>
@@ -146,6 +148,7 @@
* Find a port. If none exists, return an ICMP unreachable.
*/
if ((sock = NutUdpFindSocket(uh->uh_dport)) == 0) {
+ NutIcmpResponse(ICMP_UNREACH, ICMP_UNREACH_PORT, 0, nb);
NutNetBufFree(nb);
return;
}
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
More information about the En-Nut-Discussion
mailing list