netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is a driver allowed to modify dev->flags?
@ 2003-04-01 16:49 Rask Ingemann Lambertsen
  0 siblings, 0 replies; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2003-04-01 16:49 UTC (permalink / raw)
  To: linux-net, netdev


Hi.

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is a driver allowed to modify dev->flags?
       [not found] <3e89c32348ce76.94538914@not right>
@ 2003-04-01 16:58 ` Ben Greear
  2003-04-01 17:26 ` Donald Becker
  2003-04-02 13:01 ` Rask Ingemann Lambertsen
  2 siblings, 0 replies; 5+ messages in thread
From: Ben Greear @ 2003-04-01 16:58 UTC (permalink / raw)
  To: rask; +Cc: linux-net, netdev

Rask Ingemann Lambertsen wrote:
> Hi.
> 
> Is a network device driver allowed to modify dev->flags? For example:
> 
> 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);



-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is a driver allowed to modify dev->flags?
       [not found] <3e89c32348ce76.94538914@not right>
  2003-04-01 16:58 ` Is a driver allowed to modify dev->flags? Ben Greear
@ 2003-04-01 17:26 ` Donald Becker
  2003-04-01 17:40   ` Rask Ingemann Lambertsen
  2003-04-02 13:01 ` Rask Ingemann Lambertsen
  2 siblings, 1 reply; 5+ messages in thread
From: Donald Becker @ 2003-04-01 17:26 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: linux-net, netdev

On Tue, 1 Apr 2003, Rask Ingemann Lambertsen wrote:

> 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.

> 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?

-- 
Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Scyld Beowulf cluster system
Annapolis MD 21403			410-990-9993


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  Is a driver allowed to modify dev->flags?
  2003-04-01 17:26 ` Donald Becker
@ 2003-04-01 17:40   ` Rask Ingemann Lambertsen
  0 siblings, 0 replies; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2003-04-01 17:40 UTC (permalink / raw)
  To: linux-net, netdev


Donald Becker wrote:
> On Tue, 1 Apr 2003, Rask Ingemann Lambertsen wrote:
> 
> > 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.

> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re:  Is a driver allowed to modify dev->flags?
       [not found] <3e89c32348ce76.94538914@not right>
  2003-04-01 16:58 ` Is a driver allowed to modify dev->flags? Ben Greear
  2003-04-01 17:26 ` Donald Becker
@ 2003-04-02 13:01 ` Rask Ingemann Lambertsen
  2 siblings, 0 replies; 5+ messages in thread
From: Rask Ingemann Lambertsen @ 2003-04-02 13:01 UTC (permalink / raw)
  To: linux-net, netdev


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-02 13:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3e89c32348ce76.94538914@not right>
2003-04-01 16:58 ` Is a driver allowed to modify dev->flags? Ben Greear
2003-04-01 17:26 ` Donald Becker
2003-04-01 17:40   ` Rask Ingemann Lambertsen
2003-04-02 13:01 ` Rask Ingemann Lambertsen
2003-04-01 16:49 Rask Ingemann Lambertsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).