Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 1999 11:15:16 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        yschae@cc.gatech.edu (Youngsu Chae)
Cc:        net@FreeBSD.ORG
Subject:   Re: RAW IP socket for IGMP packet..
Message-ID:  <199905180915.LAA01270@labinfo.iet.unipi.it>
In-Reply-To: <37412853.439D35A5@cc.gatech.edu> from "Youngsu Chae" at May 18, 99 04:43:45 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Hi all,
> 
> I've been struggling with raw ip socket to pick up IP/IGMP packet.
> As I understand from the 'raw_ip.c' source code, if the following three
> conditions are satisfied
> 
> 1) open a raw ip socket with  protocol value as IPPROTO_IGMP,
> 2) do not bind local address,
> 3) do not specify foreign address,
> 
> then, the socket should get all the IP/IGMP packets with whatever
> destination group addresses.
> But, I couldn't get any IGMP packets..
> The only way I can get the IP/IGMP packet is to subscribe to a specific
> group.

this is because the interface will only receive multicast pkts for the
groups that you have done a JOIN for. if you don't join (or you are
only a sender, you don't need IGMP!)

> How can I get all IGMP packets with raw ip socket?

one option could be to put the interface in ALLMULTI or PROMISC mode.

> I've also tested with protocol value IPPROTO_IP(0).
> In this case it should pick up all IP packets except TCP/UDP (those
> packets are handled only in kernel).
> It picks up ICMP packets but not IGMPs.

the reason you cannot intercept TCP&UDP is that the IPPROTO_RAW entry in 
in_proto.c is after those for udp and tcp. Move it before and you can
override tcp & udp as well.

	cheers
	luigi
-----------------------------------+-------------------------------------
  Luigi RIZZO, luigi@iet.unipi.it  . Dip. di Ing. dell'Informazione
  http://www.iet.unipi.it/~luigi/  . Universita` di Pisa
  TEL/FAX: +39-050-568.533/522     . via Diotisalvi 2, 56126 PISA (Italy)

		  http://www.iet.unipi.it/~luigi/ngc99/
====  First International Workshop on Networked Group Communication  ====
-----------------------------------+-------------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905180915.LAA01270>