Re: Bug in packet-socket kernel code?

Mark H. Wood (mwood@IUPUI.Edu)
Sat, 26 Sep 1998 07:41:40 -0500 (EST)


On Tue, 22 Sep 1998, Alexey Kuznetsov wrote:

> Hello!

Thanks for responding.

> > Have I found a bug in linux/net/packet/af_packet.c? In packet_bind_spkt
> > the very first thing it does is check the passed length of a
> > sockaddr_spkt against sizeof(struct sockaddr). But a sockaddr_spkt has
^^^^ please excuse my typo; that should be sockaddr_pkt
> > an additional field, so its size won't match.
>
> No. We have two versions of sockaddr_spkt, one is with spkt_protocol
> field (it is 16byte), another one is with this field.

I tried:

find /usr/include -follow -name *.h -exec grep -l sockaddr_pkt \{\} \;

and only found one definition, in /usr/include/linux/if_packet.h . In
fact that is the only use of that symbol in the whole linux source tree
on my 2.1.115 system. Where is the other version of sockaddr_pkt
defined, and how would I know when to use one or the other?

Once I understand this stuff thoroughly, I'll write some packet-socket
documentation so that (one may hope) nobody will have to ask you again.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Some things are not improved when made "graphical".  Imagine how crude
Kilmer's "Trees" would be if reduced to comic-book form.

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.rutgers.edu