*BSD News Article 89846


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!howland.erols.net!news.nacamar.de!uunet!in2.uu.net!139.85.212.211!hnssysb.hns.com!usenet
From: "Kapil Chowksey (Jaeger)" <kchowksey@hss.hns.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: socket(AF_INET,SOCK_RAW,IPPROTO_ICMP) ???
Date: Sat, 22 Feb 1997 04:11:28 +0000
Organization: Hughes Software Systems
Lines: 41
Message-ID: <330E71F0.249A3EAC@hss.hns.com>
References: <330D9010.F065BD4@hss.hns.com>
NNTP-Posting-Host: valhalla.hss.hns.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (X11; I; Linux 1.1.59 i486)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:35904

Kapil Chowksey (Jaeger) wrote:
> 
> hi,
> 
> Like almost half the world, I'm trying to read ICMP pkts from a
> FreeBSD2.1.6-RELEASE box; I'm doing
> 
> socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)
> 
> then I do recvfrom's.
> 
> The result is that I can read *all* ICMP pkt types (ECHO_RESPONSE,
> TIME_EXCEEDED etc.etc.) _except_ for ICMP_ECHO (echo request)
> 
> can someone point me what changes to make to the kernel to read 'em all
> properly ?
> 

yeah - sho'nuff /usr/src/sys/netinet/ip_icmp.c (lines 439-451)

        /*       
         * No kernel processing for the following;
         * just fall through to send to raw listener.
         */      
        case ICMP_ECHOREPLY:
        case ICMP_ROUTERADVERT:
        case ICMP_ROUTERSOLICIT:
        case ICMP_TSTAMPREPLY:
        case ICMP_IREQREPLY:
        case ICMP_MASKREPLY:
        default:
                break;
        }

just add ICMP_ECHO to the list.

<<down with libpcap.a>>

--
Kapil Chowksey (Jaeger)
kchowksey@hss.hns.com