From: Hasso Tepper <hasso@estpak.ee>
To: "J. Simonetti" <jeroens@office.netland.nl>
Cc: netdev@oss.sgi.com
Subject: Re: icmp_unreachable uses wrong ip
Date: Mon, 2 May 2005 16:59:05 +0300 [thread overview]
Message-ID: <200505021659.05674.hasso@estpak.ee> (raw)
In-Reply-To: <1115040079.5620.11.camel@jeroens.office.netland.nl>
[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]
J. Simonetti wrote:
> I've recently come to notice that traceroutes through a linux router use
> the wrong ip (ip of exitting interface) wich should actually be the ip
> of the incomming interface.
There is nothing _wrong_ with this behaviour. Linux just behaves this way.
> I've found a trivial patch (attached) wich resolves this. Perhaps this
> is something to include (or have a sysctl to toggle this behaviour). I
> unfortunately have no knowledge of programming, so the sysctl option
> would have te be done by a volunteer.
Similar patches have been posted to the list repeatedly AFAIK with no any
response from developers. Can someone enlighten us why? Is there something
wrong with it? This is the feature people administrating routers would like
to have. It makes debugging complicated topologies much easier and all
routers I have seen behave this way.
I'm attaching patch which was posted to the list some time ago. I'm using it
for some time already. I can't find the post from the archive though at the
moment.
--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
[-- Attachment #2: linux-2.4.26-icmperrors.patch --]
[-- Type: text/x-diff, Size: 2298 bytes --]
diff -ru linux-2.4.26/include/linux/sysctl.h linux-2.4.26-icmperrors/include/linux/sysctl.h
--- linux-2.4.26/include/linux/sysctl.h 2004-04-14 14:05:40.000000000 +0100
+++ linux-2.4.26-icmperrors/include/linux/sysctl.h 2004-09-23 22:52:16.000000000 +0100
@@ -314,6 +314,7 @@
NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
NET_TCP_WESTWOOD=95,
NET_IPV4_IGMP_MAX_MSF=96,
+ NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=97,
};
enum {
diff -ru linux-2.4.26/net/ipv4/icmp.c linux-2.4.26-icmperrors/net/ipv4/icmp.c
--- linux-2.4.26/net/ipv4/icmp.c 2004-04-14 14:05:41.000000000 +0100
+++ linux-2.4.26-icmperrors/net/ipv4/icmp.c 2004-09-23 22:52:38.000000000 +0100
@@ -162,6 +162,7 @@
int sysctl_icmp_ratelimit = 1*HZ;
int sysctl_icmp_ratemask = 0x1818;
+int sysctl_icmp_errors_use_inbound_ifaddr = 0;
/*
* ICMP control array. This specifies what to do with each ICMP.
@@ -452,8 +453,12 @@
#endif
saddr = iph->daddr;
- if (!(rt->rt_flags & RTCF_LOCAL))
- saddr = 0;
+ if (!(rt->rt_flags & RTCF_LOCAL)) {
+ if(sysctl_icmp_errors_use_inbound_ifaddr)
+ saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
+ else
+ saddr = 0;
+ }
tos = icmp_pointers[type].error ?
((iph->tos & IPTOS_TOS_MASK) | IPTOS_PREC_INTERNETCONTROL) :
diff -ru linux-2.4.26/net/ipv4/sysctl_net_ipv4.c linux-2.4.26-icmperrors/net/ipv4/sysctl_net_ipv4.c
--- linux-2.4.26/net/ipv4/sysctl_net_ipv4.c 2004-04-14 14:05:41.000000000 +0100
+++ linux-2.4.26-icmperrors/net/ipv4/sysctl_net_ipv4.c 2004-09-23 22:53:07.000000000 +0100
@@ -22,6 +22,7 @@
extern int sysctl_icmp_echo_ignore_all;
extern int sysctl_icmp_echo_ignore_broadcasts;
extern int sysctl_icmp_ignore_bogus_error_responses;
+extern int sysctl_icmp_errors_use_inbound_ifaddr;
/* From ip_fragment.c */
extern int sysctl_ipfrag_low_thresh;
@@ -181,6 +182,9 @@
{NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses",
&sysctl_icmp_ignore_bogus_error_responses, sizeof(int), 0644, NULL,
&proc_dointvec},
+ {NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr",
+ &sysctl_icmp_errors_use_inbound_ifaddr, sizeof(int), 0644, NULL,
+ &proc_dointvec},
{NET_IPV4_ROUTE, "route", NULL, 0, 0555, ipv4_route_table},
#ifdef CONFIG_IP_MULTICAST
{NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships",
next prev parent reply other threads:[~2005-05-02 13:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-02 13:21 icmp_unreachable uses wrong ip J. Simonetti
2005-05-02 13:59 ` Hasso Tepper [this message]
2005-05-02 14:52 ` Patrick McHardy
2005-05-02 17:38 ` Hasso Tepper
2005-05-02 22:04 ` Patrick McHardy
2005-05-03 6:44 ` Hasso Tepper
2005-05-03 18:15 ` Patrick McHardy
2005-05-03 23:35 ` Hasso Tepper
2005-05-03 23:37 ` Patrick McHardy
2005-05-04 8:29 ` Lennert Buytenhek
2005-05-04 7:03 ` Meelis Roos
2005-05-03 11:46 ` Hasso Tepper
2005-05-03 9:22 ` Lennert Buytenhek
2005-05-03 9:42 ` Pekka Savola
2005-05-03 10:38 ` Lennert Buytenhek
2005-05-03 11:00 ` Hasso Tepper
2005-05-04 1:15 ` Glen Turner
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=200505021659.05674.hasso@estpak.ee \
--to=hasso@estpak.ee \
--cc=jeroens@office.netland.nl \
--cc=netdev@oss.sgi.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).