lkml.org 
[lkml]   [1996]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectWarning to all gated users.
Date
Hello!

My story.
I run gated almost for year and never had serious problems.
Well, sometimes I saw in logs funny message "OSPF: packet size > ip length",
but it occured very rarely and did not broke anything,
so that I believed that it is a harmless Cisco bug.

Yesterday, my gated stopped to talk to Cisco and logs
were overfill with this message. Unfortunately, at this time
I debugged my "next generation" routing code and decided
that I broke something. I backtraced changes, no guess.
Rebooted old, good kernel - it does not work! Disaster!

Gated turned out to believe that raw packets contain
in ip length field not tot_len in net order, but length of
datagram payload(!) in HOST order(!!).


What is it? Bug in gated? Idiotic BSD feature?
Can someone explain it?


Well, raw.c contains:

skb->daddr = saddr;

#if 0
/*
* For no adequately explained reasons BSD likes to mess up the header of
* the received frame.
*/

if(sk->bsdism)
skb->ip_hdr->tot_len=ntohs(skb->ip_hdr->tot_len-4*skb->ip_hdr->ihl);
#endif

if (sk->users) {

(BTW, it was incorrect, when it was not commented.

First, it should look as:

skb->ip_hdr->tot_len=ntohs(skb->ip_hdr->tot_len)-4*skb->ip_hdr->ihl;

Second, if this packet will be backlogged, we garble it up to death
at redo.
And third, if this skb is clone of another, it will garble it too,
so that this fix should be done in raw_recvmsg in user buffer)


Alexey Kuznetsov.


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.034 / U:3.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site