patch-2.3.99-pre1 linux/drivers/net/wan/sbni.c

Next file: linux/drivers/net/wan/sdla.c
Previous file: linux/drivers/net/wan/mixcom.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.51/linux/drivers/net/wan/sbni.c linux/drivers/net/wan/sbni.c
@@ -101,7 +101,7 @@
 static int  sbni_close(struct net_device *dev);
 static void sbni_drop_tx_queue(struct net_device *dev);
 static struct enet_statistics *sbni_get_stats(struct net_device *dev);
-void card_start(struct net_device *dev);
+static void card_start(struct net_device *dev);
 static inline unsigned short sbni_recv(struct net_device *dev);
 void change_level(struct net_device *dev);
 static inline void sbni_xmit(struct net_device *dev);
@@ -647,7 +647,7 @@
 	return 0;
 }
 
-void card_start(struct net_device *dev)
+static void card_start(struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local*)dev->priv;
    
@@ -1200,6 +1200,8 @@
 		}
 		case SIOCDEVRESINSTATS:
 		{
+			if(!capable(CAP_NET_ADMIN))
+				return -EPERM;
 			DP( printk("%s: SIOCDEVRESINSTATS\n",dev->name); )
 			lp->in_stats.all_rx_number = 0;
 			lp->in_stats.bad_rx_number = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)