Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 1999 10:55:28 +0100
From:      Cillian Sharkey <cillian@baker.ie>
To:        Niall Smart <niall@pobox.com>
Cc:        hackers@freebsd.org, questions@freebsd.org
Subject:   Re: Various Questions
Message-ID:  <37B29A10.2DD73A0A@baker.ie>
References:  <37B20EBE.76AC89DA@baker.ie> <37B2B02B.90751E96@pobox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> >                 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-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37B29A10.2DD73A0A>