Date: Thu, 12 Aug 1999 01:01:02 +0100 From: Cillian Sharkey <cillian@baker.ie> To: Doug White <dwhite@resnet.uoregon.edu> Cc: questions@freebsd.org, hackers@freebsd.org Subject: Re: Various Questions Message-ID: <37B20EBE.76AC89DA@baker.ie>
next in thread | raw e-mail | index | archive | help
> > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37B20EBE.76AC89DA>