Re: linux-kernel-digest V1 #2653

Jon Lewis (jlewis@inorganic5.fdt.net)
Wed, 7 Oct 1998 02:49:24 -0400 (EDT)


On Tue, 6 Oct 1998 Shaun Wilson <plexus@ionet.net> wrote:

> I'm not sure how viable this is, or the likelyhood of inclusion into
> future kernels since I personally don't know how annoying having the
> ip output might be. or that my method of shifting also fits for an
> other platform.
>
> I'm not done, but here's the diff so far. Could someone verify that the
> ip being returned is correct? As I don't have any means of testing this
> (well, okay, maybe i'm just too lazy..)

First, this is pretty much a waste of time, since anyone who sends you
invalid fragments is assuredly going to forge the source address. The
tools for this (nestea for example) have saddr as a required argument.

> - ------ cut -------
> - --- ip_fragment.c.old Mon Sep 28 07:21:20 1998
> +++ ip_fragment.c Tue Oct 6 12:12:23 1998
> @@ -389,8 +389,9 @@
> return skb;
>
> out_invalid:
> - - NETDEBUG(printk(KERN_ERR
> - - "Invalid fragment list: Fragment over size.\n"));
> + NETDEBUG(printk(KERN_ERR "Invalid fragment list: Fragment over size [Sender: %d.%d.%d.%d]\n",
> + qp->iph->saddr>>24, (qp->iph->saddr<<8)>>24,
> + (qp->iph->saddr<<16)>>24, (qp->iph->saddr<<24)>>24));

There's a macro for all that messy stuff in <linux/kernel.h>.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Spammers will be winnuked or
Network Administrator | drawn and quartered...whichever
Florida Digital Turnpike | is more convenient.
______http://inorganic5.fdt.net/~jlewis/pgp for PGP public key____

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/