My code is not cool. But it is still useful.
My code is made to test networking sanity between two IP peers. It uses raw
socket and 4 bytes IP payload.
I REALLY surprised that my code did not work on Linux 2.4.x. Sillily I spent
lots of time to find out what was the problem.
Finally what I found is what Morten Schlaeger(the author of the first thread
of this postings) had found.
Who wrote this RFC-non-conforming code ?
>From Morten's posting:
the code which discards our packets (File ip_input.c; function int
ip_local_deliver_finish(struct sk_buff *skb)
227 /* Pull out additionl 8 bytes to save some space in
228 if (!pskb_may_pull(skb, ihl+8))
229 goto out;
230 __skb_pull(skb, ihl);
static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
if (len <= skb_headlen(skb))
if (len > skb->len)
return (__pskb_pull_tail(skb, len-skb_headlen(skb)) != NULL);
----- Original Message -----
From: "David S. Miller" <firstname.lastname@example.org>
Cc: <email@example.com>; <firstname.lastname@example.org>
Sent: Wednesday, January 09, 2002 8:51 PM
Subject: Re: Don't use IP packets with payload < 8 octets
> From: Morten Schlaeger <email@example.com>
> Date: Wed, 9 Jan 2002 10:46:56 +0100 (CET)
> So, I think your statement is only true for the fragments of a
> packet. Further the appendix of RFC 791 gives the following example:
> Man, if it weren't for RAW sockets I would be now asking
> you "Now show me a legitimate IP packet that has one byte
> of data".
> Probably the correct test is therefore something like:
> if (ipprot_exists(iph->protocol) &&
> pskb_may_pull(skb, ihl + 8))
> goto out;
> And at that point this added overhead defeats the whole purpose of
> consolidating the pskb_may_pull() from the protocol inputs, into
> the generic IP input. :-(
> So I'm going to ask anyways, what cool RAW sockets app uses these 1
> byte packets? :-)
> Franks a lot,
> David S. Miller
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to firstname.lastname@example.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:14 EST