From owner-freebsd-questions Thu Apr 9 07:11:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA00273 for freebsd-questions-outgoing; Thu, 9 Apr 1998 07:11:00 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from igw3.watson.ibm.com (igw3.watson.ibm.com [198.81.209.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA00262 for ; Thu, 9 Apr 1998 07:10:48 -0700 (PDT) (envelope-from ribo@watson.ibm.com) Received: from mailhub1.watson.ibm.com (mailhub1.watson.ibm.com [9.2.249.31]) by igw3.watson.ibm.com (8.8.7/07-11-97) with ESMTP id KAA11130 for ; Thu, 9 Apr 1998 10:10:46 -0400 Received: from ribox.watson.ibm.com (ribox.watson.ibm.com [9.2.24.24]) by mailhub1.watson.ibm.com (8.8.7/Feb-20-98) with SMTP id KAA11780 for ; Thu, 9 Apr 1998 10:10:46 -0400 Received: by ribox.watson.ibm.com (AIX 4.1/UCB 5.64/4.03) id AA20462; Thu, 9 Apr 1998 10:04:11 -0400 Date: Thu, 9 Apr 1998 10:04:11 -0400 From: ribo@watson.ibm.com (Bob Flavin) Message-Id: <9804091404.AA20462@ribox.watson.ibm.com> To: questions@FreeBSD.ORG Subject: IFF_PROMISC getting into promiscuous mode Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG How do you get an ethernet adapter running in promiscuous mode? I open a socket: sock = socket(AF_INET, SOCK_DGRAM, 0); and GET, OR and SET the IFF_DEBUG and IFF_PROMISC bits with ioctl(sock, SIOCGIFFLAGS, (char*)&ifr); ... ioctl(sock, SIOCSIFFLAGS, (char*)&ifr); this seems to work because: ifconfig fxp0 shows the DEBUG and PROMISC flags on. However, I don't get a stream of packets in the loop that read()'s packets. That uses another socket, previously opened as: s = socket(AF_INET, SOCK_RAW, IPPROTO_IP); (On another system (AIX) I use AF_INTF for the read() socket, FreeBSD doesn't seem to have this.) What do I do? Do you have any samples of (non-BPF) sniffer code? Bob To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message