From owner-freebsd-questions Wed Aug 11 16: 2:56 1999 Delivered-To: freebsd-questions@freebsd.org Received: from vax1.baker.ie (VAX1.baker.IE [194.125.50.91]) by hub.freebsd.org (Postfix) with SMTP id 1534915636; Wed, 11 Aug 1999 16:02:48 -0700 (PDT) (envelope-from cillian@baker.ie) Received: from baker.ie ([194.106.150.250]) by vax1.baker.ie with ESMTP; Thu, 12 Aug 1999 0:08:10 +0100 Message-ID: <37B20EBE.76AC89DA@baker.ie> Date: Thu, 12 Aug 1999 01:01:02 +0100 From: Cillian Sharkey X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Doug White Cc: questions@freebsd.org, hackers@freebsd.org Subject: Re: Various Questions Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > when a network interface is put into promiscuous mode, a kernel > > > message is logged ie. "ep0: promiscuous mode enabled" are there plans > > > to log the reverse of this message ie. "ep0: promiscuous mode > > > disabled"..I think this was suggested before in the mailing-lists but > > > did anything come of it ? > > > > Not that I saw. Patches would accelerate the process, probably :-) > Patches certainly would.. :) here's a patch for /sys/net/if.c that works on 3.2-STABLE for the ep0 and lo0 interfaces (only ones I tested) all I did was add in 2 lines of code (whoopee doo..) my inserted lines start with "--->" However will this work with all interfaces ?? this was the only code I could find that calls log() to record a "promiscuous mode enabled" message so I guess in theory the following should work for all interfaces ? (correct me if I'm wrong..) -- snip -- if (pswitch) { /* * If the device is not configured up, we cannot put it in * promiscuous mode. */ if ((ifp->if_flags & IFF_UP) == 0) return (ENETDOWN); if (ifp->if_pcount++ != 0) return (0); ifp->if_flags |= IFF_PROMISC; log(LOG_INFO, "%s%d: promiscuous mode enabled\n", ifp->if_name, ifp->if_unit); } else { if (--ifp->if_pcount > 0) return (0); ifp->if_flags &= ~IFF_PROMISC; ---> log(LOG_INFO, "%s%d: promiscuous mode disabled\n", ---> ifp->if_name, ifp->if_unit); } -- snip -- - Cillian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message