From owner-freebsd-hackers Thu Aug 12 3: 8:59 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from vax1.baker.ie (VAX1.baker.IE [194.125.50.91]) by hub.freebsd.org (Postfix) with SMTP id AA14514D46; Thu, 12 Aug 1999 03:08:52 -0700 (PDT) (envelope-from cillian@baker.ie) Received: from baker.ie ([194.125.50.55]) by vax1.baker.ie with ESMTP; Thu, 12 Aug 1999 11:14:12 +0100 Message-ID: <37B29A10.2DD73A0A@baker.ie> Date: Thu, 12 Aug 1999 10:55:28 +0100 From: Cillian Sharkey X-Mailer: Mozilla 4.6 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: Niall Smart Cc: hackers@freebsd.org, questions@freebsd.org Subject: Re: Various Questions References: <37B20EBE.76AC89DA@baker.ie> <37B2B02B.90751E96@pobox.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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); > > Shouldn't this be: > > if (ipf->if_flags & IFF_PROMISC) { > ipf->if_flags &= ~IFF_PROMISC; > log(LOG_INFO, "%s%d: promiscuous mode disabled\n", ifp->if_name, > ifp->if_unit); > } > > Or is the test for IFF_PROMISC made earlier in the code? You > should only print a disabled message when it has previously > been enabled so that log file watchers can always match up > the up/down pairs. yes that I think that would be a better idea to check to see if it is actually in promiscuous mode first before printing out our disabled message so all pairs match..however doesn't the following code from above seem to gaurd against this situation : ? if (--ifp->if_pcount > 0) return (0); from what I can see, it only turns off promiscuous mode if if_pcount reaches zero, ie. all requests for promiscuous mode to be off account for all the previous requests for promiscuous mode to be on..? ..then again I'm no expert kernel hacker (yet!) and I certainly don't pretend to be one either, so I'll leave this to the experts :-D - Cillian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message