Re: RAW Socket

ak@muc.de
Sun, 19 Apr 1998 18:34:34 +0200


On Sun, Apr 19, 1998 at 05:37:48PM +0200, Richard B. Johnson wrote:
> On Sun, 19 Apr 1998, Philip Blundell wrote:
>
> > >socket(AF_INET, SOCK_PACKET, 0) returns Protocol not supported.
> > >socket(AF_INET, AF_PACKET, 0) returns Invalid argument
> > >socket(AF_PACKET, SOCK_PACKET, 0) returns Invalid argument
> >
> > Compile AF_PACKET into your kernel and try again. BTW, you want to use
> > SOCK_DGRAM with AF_PACKET.
> >
>
> It is.
>
>
> CONFIG_M586=y
> CONFIG_MODULES=y
> CONFIG_NET=y
> CONFIG_PCI=y
> CONFIG_PCI_BIOS=y
> CONFIG_PCI_DIRECT=y
> CONFIG_SYSVIPC=y
> CONFIG_SYSCTL=y
> CONFIG_BINFMT_AOUT=y
> CONFIG_BINFMT_ELF=y
> CONFIG_BLK_DEV_FD=y
> CONFIG_PARIDE_PARPORT=y
> CONFIG_PACKET=y <====
> CONFIG_NETLINK=y
> CONFIG_UNIX=y
> CONFIG_INET=y
> CONFIG_IP_NOSR=y
> CONFIG_SKB_LARGE=y
>
>
> Also...
>
> socket(AF_PACKET, SOCK_DGRAM, 0) returns Invalid argument.

Replace that with socket(AF_INET, SOCK_DGRAM, ntohs(ETH_P_ALL));

(or ETH_P_IP if you only want to see IPv4 traffic).

-Andi

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