From owner-freebsd-net Tue May 18 4:21:28 1999 Delivered-To: freebsd-net@freebsd.org Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (Postfix) with SMTP id C17B815581 for ; Tue, 18 May 1999 04:21:23 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA01270; Tue, 18 May 1999 11:15:17 +0200 From: Luigi Rizzo Message-Id: <199905180915.LAA01270@labinfo.iet.unipi.it> Subject: Re: RAW IP socket for IGMP packet.. To: yschae@cc.gatech.edu (Youngsu Chae) Date: Tue, 18 May 1999 11:15:16 +0200 (MET DST) Cc: net@FreeBSD.ORG In-Reply-To: <37412853.439D35A5@cc.gatech.edu> from "Youngsu Chae" at May 18, 99 04:43:45 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1706 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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