From owner-freebsd-net Tue May 18 1:45:58 1999 Delivered-To: freebsd-net@freebsd.org Received: from jisong.cc.gatech.edu (acmex.gatech.edu [130.207.165.22]) by hub.freebsd.org (Postfix) with ESMTP id 17BEA1550C for ; Tue, 18 May 1999 01:45:44 -0700 (PDT) (envelope-from yschae@cc.gatech.edu) Received: from cc.gatech.edu (localhost [127.0.0.1]) by jisong.cc.gatech.edu (8.9.1/8.9.1) with ESMTP id EAA01512; Tue, 18 May 1999 04:44:05 -0400 (EDT) (envelope-from yschae@cc.gatech.edu) Message-ID: <37412853.439D35A5@cc.gatech.edu> Date: Tue, 18 May 1999 04:44:04 -0400 From: Youngsu Chae Organization: College of Computing, Georgia Tech X-Mailer: Mozilla 4.51 [en] (X11; U; FreeBSD 3.0-RELEASE i386) X-Accept-Language: ko, en MIME-Version: 1.0 To: net@freebsd.org Subject: RAW IP socket for IGMP packet.. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. That gives me only the IGMP packets destined to the group. How can I get all IGMP packets with raw ip socket? 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 following is the code for opening raw IP socket for IGMP.. /* get an IGMP socket */ if ((igmp_socket = socket(AF_INET,SOCK_RAW,IPPROTO_IGMP)) < 0){ panic ("socket() failed!"); } k_hdr_include(TRUE); /* turn on header include option */ k_set_rcvbuf(256*1024,48*1024); /* lots of input buffering */ k_set_ttl(1); /* restrict multicasts to one hop */ k_set_loop(FALSE); /* disable multicast loopback */ Thanks, Y.Chae To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message