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