On Thu, Mar 07, 2002 at 07:35:16PM -0800, Hossain, Mohammad wrote:
> Would you pls check if the code below works in your Linux IPv6 machine?
Well, it "works": no errors, but no data from the socket either.
Not sure whether this applies to IPv6 too, but I'll quote the raw(7) man
page for ipv4 raw sockets:
---
raw_socket = socket(PF_INET, SOCK_RAW, int protocol);
All packets or errors matching the protocol number specified for the raw
socket are passed to this socket. For a list of the allowed protocols
see RFC1700 assigned numbers and getprotobyname(3).
A protocol of IPPROTO_RAW implies enabled IP_HDRINCL and receives all IP
protocols. Sending is not allowed.
..
An IPPROTO_RAW socket is send only. If you really want to receive all
IP packets use a packet(7) socket with the ETH_P_IP protocol. Note that
packet sockets don't reassemble IP fragments, unlike raw sockets.
---
Which, to me, seems a bit contradictory. Anyway, that might be the cause
of your problems - you might want to try specifying the protocol in your
call to socket, if possible.
--
>#v1&#:<-1<-1\0\_.@ "You cannot escape from window 0!"
>2-!#v_:2\^fibre^-< fizban at iki dot fi
^:_ >$1>\#+:#$!_1^ PGP key fp 657AF64968F12E6ECBE5F90E421C1FDF9EC09E94
|