netdev
[Top] [All Lists]

Re: IPv6 Raw socket problem in Linux 7.2

To: "Hossain, Mohammad" <m_hossain@xxxxxxxxxxxx>
Subject: Re: IPv6 Raw socket problem in Linux 7.2
From: "'Heikki Kallasjoki'" <fizban@xxxxxx>
Date: Fri, 8 Mar 2002 09:49:18 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <AA70E30319FAD411AC6E00A0C95D7ABD01EE75F8@fmsmsx61.fm.intel.com>; from m_hossain@trillium.com on Thu, Mar 07, 2002 at 07:35:16PM -0800
Mail-followup-to: "Hossain, Mohammad" <m_hossain@xxxxxxxxxxxx>, netdev@xxxxxxxxxxx
References: <AA70E30319FAD411AC6E00A0C95D7ABD01EE75F8@fmsmsx61.fm.intel.com>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
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

<Prev in Thread] Current Thread [Next in Thread>