[4037] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: ICMP Redirect...

daemon@ATHENA.MIT.EDU (Zach B.)
Fri Aug 16 04:30:44 1996

Date: 	Thu, 15 Aug 1996 15:56:28 -0700 (PDT)
From: "Zach B." <zab@teleport.com>
To: Dan Merillat <harik@ao.net>
cc: Linux-Net List <linux-net@vger.rutgers.edu>
In-Reply-To: <Pine.LNX.3.93.960815021038.10809A-100000@eola.ao.net>

On Thu, 15 Aug 1996, Dan Merillat wrote:

> Ok, I was poking thru the kernel because I get a lot of ICMP redirects.
> Now, I know getting one means to fix your routes.  However, to much
> information is thrown away.  All that gets sysloged is the host that sent
> it!  I tried a quickie patch to display some of the other fields but now
> ICMP's just oops my kernel, so I screwed something up.  If someone could
> write a one-liner and send it to me I'd appreciate it.  I don't know
> enough about ICMP fields to write it well, and the development time
> is killer (since I am supposed to be working on other things... grr.)
> Jobs arn't fun when they conflict with work I want to do.
>
>
> --Dan


Well I'm far too lazy to producce a diff :).  The relevant bits are in
net/ipv4/icmp.c around line 827 (someone holler if I'm doing this wrong):

        case ICMP_REDIR_HOST:
            /*
             *  Add better route to host.
             *  But first check that the redirect
             *  comes from the old gateway..
             *  And make sure it's an ok host address
             *  (not some confused thing sending our
             *  address)
             */
            printk(KERN_INFO "ICMP redirect from %s\n", in_ntoa(source));
            ip_rt_redirect(source, ip, icmph->un.gateway, dev);
            break;

simply change that to

        case ICMP_REDIR_HOST:
            /*
             *  Add better route to host.
             *  But first check that the redirect
             *  comes from the old gateway..
             *  And make sure it's an ok host address
             *  (not some confused thing sending our
             *  address)
             */
    	    printk(KERN_INFO "icmp: ICMP host redirect accepted. dest = %lX,
           	orig gw = %lX, \"new\" gw = %lX, device = %s.\n", ntohl(ip),
		ntohl(source), ntohl(icmph->un.gateway), dev->name));
	    ip_rt_redirect(source, ip, icmph->un.gateway, dev);
            break;


minus the evil wrapping of course.  Oh, this is from a 2.0.10 tree, but
I'm sure more recent ones are similar.  Oh, while I'm here.. has anyone
seen a version of ipsend that has been patched up for the 2.0 sources?

zach







home help back first fref pref prev next nref lref last post