Skip to contentSkip to conversation

Is a driver allowed to modify dev->flags?

DISCUSSION Ben Greear 3 participants 4 messages Apr 1, 2003 – Apr 2, 2003 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 3e89c32348ce76.94538914@not right

Ben Greear

author
#1 lore raw
Quoted 4 lines · Rask Ingemann Lambertsen

Hi.

Is a network device driver allowed to modify dev->flags? For example:

Quoted 9 lines

if (dev->flags & IFF_ALLMULTI)

        dev->flags |= IFF_PROMISC;

I've found it to cause the IFF_PROMISC flag to stick when using "tcpdump -p", which to my surprice sets the IFF_ALLMULTI flag.

Regards,
Rask Ingemann Lambertsen

You are supposed to increment the promisc requestors. I think something like this:

dev_set_promiscuity(dev, 1);

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Rask Ingemann Lambertsen

Is a network device driver allowed to modify dev->flags? For example:

if (dev->flags & IFF_ALLMULTI)

        dev->flags |= IFF_PROMISC;

You must be looking at the atp.c driver, or a driver that cribbed from it. (Is anyone still running a parallel port Ethernet device?!)

Alan Cox added this code to atp.c because the chip doesn't have a reasonable multicast filter. The only way to receive all multicast traffic was to turn on promiscuous mode. But that caused a problem with some parts of the protocol stack were passed traffic not intended for the local host.

A better solution (which is usually easier to see later) is to have the driver do the trivial final packet filtering itself.

Quoted 2 lines

I've found it to cause the IFF_PROMISC flag to stick when using "tcpdump -p", which to my surprice sets the IFF_ALLMULTI flag.

Which driver are you using?

Signature · 4 lines
Donald Becker				[email protected]
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Scyld Beowulf cluster system
Annapolis MD 21403			410-990-9993
#3 lore raw
Quoted 9 lines · Donald Becker
Quoted 4 lines · Rask Ingemann Lambertsen

Is a network device driver allowed to modify dev->flags? For example:

if (dev->flags & IFF_ALLMULTI)

        dev->flags |= IFF_PROMISC;

You must be looking at the atp.c driver, or a driver that cribbed from it. (Is anyone still running a parallel port Ethernet device?!)

No, but I've seen such code in other Ethernet drivers and adopted it for my NE3200 driver.

Quoted 4 lines
Quoted 2 lines

I've found it to cause the IFF_PROMISC flag to stick when using "tcpdump -p", which to my surprice sets the IFF_ALLMULTI flag.

Which driver are you using?

My experimental NE3200 driver, linux 2.4.20 and tcpdump from Redhat 7.3.

Regards,
Rask Ingemann Lambertsen

#4 lore raw
In reply to a message not in the archive
Quoted 4 lines · I wrote:

Is a network device driver allowed to modify dev->flags? For example:

if (dev->flags & IFF_ALLMULTI)

        dev->flags |= IFF_PROMISC;

Maybe the right question is: Is it necessary for the driver to set the IFF_PROMISC flag if the device enters promiscuous mode because it doesn't support all-multicast mode?

Regards,
Rask Ingemann Lambertsen