netdev
[Top] [All Lists]

[PATCH] Plip ioctl bug

To: netdev@xxxxxxxxxxx, Jeff Garzik <jgarzik@xxxxxxxxx>, Nimrod Zimerman <zimerman@xxxxxxxxxxxxxxx>, Niibe Yutaka <gniibe@xxxxxxxxx>
Subject: [PATCH] Plip ioctl bug
From: Jean Tourrilhes <jt@xxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2004 16:11:54 -0700
Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA.
E-mail: jt@xxxxxxxxxx
Organisation: HP Labs Palo Alto
Reply-to: jt@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
        Hi all,

        Plip should verify that it got the proper ioctl to avoid false
positive. User reported that plip suddenly was gaining wireless
capability ;-)
        Have fun...

        Jean

Signed-off-by: $me
------------------------------------------

diff -u -p linux/drivers/net/plip.b0.c linux/drivers/net/plip.c
--- linux/drivers/net/plip.b0.c Fri Jun 11 16:00:13 2004
+++ linux/drivers/net/plip.c    Fri Jun 11 16:03:14 2004
@@ -1219,6 +1219,11 @@ plip_ioctl(struct net_device *dev, struc
        struct net_local *nl = netdev_priv(dev);
        struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
 
+       /* Respond only to our IOCTL, ignore other IOCTLs, such as
+        * Ethtool and Wireless Extensions. Jean II */
+       if(cmd != SIOCDEVPLIP)
+               return -EOPNOTSUPP;
+
        switch(pc->pcmd) {
        case PLIP_GET_TIMEOUT:
                pc->trigger = nl->trigger;

<Prev in Thread] Current Thread [Next in Thread>