From owner-freebsd-questions Thu Aug 12 2:36:32 1999 Delivered-To: freebsd-questions@freebsd.org Received: from relay02.indigo.ie (relay02.indigo.ie [194.125.133.226]) by hub.freebsd.org (Postfix) with SMTP id EB6C014E9F for ; Thu, 12 Aug 1999 02:36:28 -0700 (PDT) (envelope-from niall@pobox.com) Received: (qmail 19052 messnum 46178 invoked from network[194.125.134.55/ts01-055.dublin.indigo.ie]); 12 Aug 1999 09:33:34 -0000 Received: from ts01-055.dublin.indigo.ie (HELO pobox.com) (194.125.134.55) by relay02.indigo.ie (qp 19052) with SMTP; 12 Aug 1999 09:33:34 -0000 Message-ID: <37B2B02B.90751E96@pobox.com> Date: Thu, 12 Aug 1999 11:29:47 +0000 From: Niall Smart X-Mailer: Mozilla 4.6 [en] (X11; I; FreeBSD 3.2-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Cillian Sharkey Cc: Doug White , questions@freebsd.org, hackers@freebsd.org Subject: Re: Various Questions References: <37B20EBE.76AC89DA@baker.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -- 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); 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. Regards, Niall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message