Re: Another SOCK_PACKET question

Andi Kleen (ak@muc.de)
09 Jan 1998 21:07:01 +0100


longd <maxwell@europa.com> writes:

> I'm sure there is a list more appropriate to these questions.. if you know
> of one please point me to it. one more question:
>
> linsniff.c sets promisc mode on an interface with ioctl() a la:
>
> ioctl(s,SIOCSIFFLAGS,&ifr);
>
> s is a descriptor pointing to the previously opened SOCK_PACKET socket..
> it seems to me that the s descriptor is purely arbitrary.. is it necessary
> to use a socket opened in this way as a descriptor for a SIOCSIFFLAGS or
> SIOCGIFFLAGS ioctl call? What type of descriptor needs to be used here?

You're right. The only requirement is that the descriptor is opened by
a socket() call so that the socket layer sees the ioctl.

-Andi