On Sun, Jul 07, 2002 at 05:06:03AM +0400, Ricardo Branco wrote:
> The patch does not work.

"Does not work" in what sense?

> it's strange, the setsockopt() fails to do the work without returning -1

I.e., it doesn't appear to put the interface into promiscuous mode?

If so, what are you doing to check whether the interface is in
promiscuous mode?

A quick look at "dev_ifsioc()" and "dev_set_promiscuity()" in
"net/core/dev.c" in the 2.2.18 kernel seems to indicate that

        1) SIOCGIFFLAGS will return the setting of IFF_PROMISC in the
           device's "gflags" field, not in its "flags" field

and

        2) the "setsockopt()" will set IFF_PROMISC in the "flags" field
           but not the "gflags" field

so, if "ifconfig" uses SIOCGIFFLAGS to get the state of the flags it
reports, "ifconfig" will, as far as I can tell, *not* report that an
interface is in promiscuous mode if it's been put into promiscuous mode
by that "setsockopt()" call.

So if you did an "ifconfig" to check whether the interface is in
promiscuous mode, that might mistakenly lead you to believe it wasn't.

Note also that putting an interface into promiscuous mode doesn't
guarantee that it'll see any traffic other than broadcast/multicast
traffic and unicast traffic to or from the machine:

        http://www.ethereal.com/faq.html#q5.1

(which is a FAQ that we should probably put into the tcpdump FAQ as
well).
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to