[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: Crazy modules names still in 2.1.84!
From:       Regis Duchesne <regis () via ! ecp ! fr>
Date:       1998-01-31 17:28:26
[Download RAW message or body]

> > 	I thought that this bug was fixed, or at least that a patch was made
> > available on the list.  Am I mistaken?

> Note that Linus usually doesn't search this list for patches.  Email
> them directly to him if you want it included.
That's eaxctly what I did last time. Anyway, I post the fix again, it has
been tested.

--- linux/net/core/dev.c.orig	Tue Jan 27 18:45:46 1998
+++ linux/net/core/dev.c	Wed Jan 28 04:24:03 1998
@@ -49,6 +49,7 @@
  *	    Thomas Bogendoerfer :	Return ENODEV for dev_open, if there
  *					is no device open function.
  *		Andi Kleen	:	Fix error reporting for SIOCGIFCONF
+ *		Régis Duchesne	:	Fix the argument check in dev_ioctl()
  *
  */
 
@@ -1534,7 +1535,6 @@
 	return -EINVAL;
 }
 
-
 /*
  *	This function handles all "interface"-type I/O control requests. The actual
  *	'doing' part of this is dev_ifsioc above.
@@ -1566,25 +1566,19 @@
 		return dev_ifname((struct ifreq *)arg);
 	}
 
+	/*
+	 *	Fetch the interface name from the info block. 
+	 */
+
 	if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
 		return -EFAULT;
-
 	ifr.ifr_name[IFNAMSIZ-1] = 0;
-
 #ifdef CONFIG_NET_ALIAS
 	colon = strchr(ifr.ifr_name, ':');
 	if (colon)
 		*colon = 0;
 #endif
 
-	/*
-	 *	See which interface the caller is talking about. 
-	 */
-	 
-#ifdef CONFIG_KERNELD
-	dev_load(ifr.ifr_name);
-#endif	
-
 	switch(cmd) 
 	{
 		/*
@@ -1602,6 +1596,9 @@
 		case SIOCGIFMAP:
 		case SIOCGIFINDEX:
 		case SIOCGIFTXQLEN:
+#ifdef CONFIG_KERNELD
+			dev_load(ifr.ifr_name);
+#endif	
 			ret = dev_ifsioc(&ifr, cmd);
 			if (!ret) {
 #ifdef CONFIG_NET_ALIAS
@@ -1632,6 +1629,9 @@
 		case SIOCSIFTXQLEN:
 			if (!suser())
 				return -EPERM;
+#ifdef CONFIG_KERNELD
+			dev_load(ifr.ifr_name);
+#endif	
 			rtnl_lock();
 			ret = dev_ifsioc(&ifr, cmd);
 			rtnl_unlock();
@@ -1652,6 +1652,9 @@
 		default:
 			if (cmd >= SIOCDEVPRIVATE &&
 			    cmd <= SIOCDEVPRIVATE + 15) {
+#ifdef CONFIG_KERNELD
+				dev_load(ifr.ifr_name);
+#endif	
 				rtnl_lock();
 				ret = dev_ifsioc(&ifr, cmd);
 				rtnl_unlock();
@@ -1664,8 +1667,15 @@
 				if (IW_IS_SET(cmd)) {
 					if (!suser())
 						return -EPERM;
+#ifdef CONFIG_KERNELD
+					dev_load(ifr.ifr_name);
+#endif	
 					rtnl_lock();
 				}
+#ifdef CONFIG_KERNELD
+				else
+					dev_load(ifr.ifr_name);
+#endif	
 				ret = dev_ifsioc(&ifr, cmd);
 				if (IW_IS_SET(cmd))
 					rtnl_unlock();

Regis "HPReg" Duchesne - Engineering Student at ***** ******** *****
        www              http://www.via.ecp.fr/~regis/
       (O o)             I use Linux & 3Com (1135 KB/s over 10Mb/s ethernet)
--.oOO--(_)--OOo.-----------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic