From owner-freebsd-current Fri Mar 17 15: 3:23 2000 Delivered-To: freebsd-current@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 88B8E37B55D for ; Fri, 17 Mar 2000 15:03:18 -0800 (PST) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.2) id PAA70386 for freebsd-current@freebsd.org; Fri, 17 Mar 2000 15:03:18 -0800 (PST) From: Archie Cobbs Message-Id: <200003172303.PAA70386@bubba.whistle.com> Subject: ICMP socket weirdness To: freebsd-current@freebsd.org Date: Fri, 17 Mar 2000 15:03:18 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Can someone explain the weird behavior I'm seeing from the program below?? When the program is run, if you ping the IP address from the local machine, it sees packets. However, if you ping it from a remote machine, it doesn't see packets. This is on a 3.4-REL machine.. it also happens on a 4.0-current machine built on approx Feb. 2. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com #include #include #include #include #include #include #include #include #include int main(int ac, char *av[]) { struct sockaddr_in a; u_char buf[8192]; int r, s; memset(&a, 0, sizeof(a)); a.sin_family = AF_INET; a.sin_len = sizeof(a); if (ac != 2 || inet_aton(av[1], &a.sin_addr) == 0) errx(1, "Usage: stest ipaddr"); if ((s = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1) err(1, "socket"); if (bind(s, (struct sockaddr *)&a, sizeof(a)) == -1) err(1, "bind"); while ((r = read(s, buf, sizeof(buf))) > 0) printf("Rec'd %d byte packet\n", r); if (r != 0) err(1, "read"); return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message