patch-2.1.132 linux/net/wanrouter/wanmain.c

Next file: linux/scripts/checkhelp.pl
Previous file: linux/net/rose/rose_dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/net/wanrouter/wanmain.c linux/net/wanrouter/wanmain.c
@@ -25,6 +25,8 @@
 * Oct 15, 1997  Farhan Thawar   changed wan_encapsulate to add a pad byte of 0
 * Apr 20, 1998	Alan Cox	Fixed 2.1 symbols
 * May 17, 1998  K. Baranowski	Fixed SNAP encapsulation in wan_encapsulate
+* Dec 15, 1998  Arnaldo Melo    support for firmwares of up to 128000 bytes
+*                               check wandev->setup return value
 *****************************************************************************/
 
 #include <linux/stddef.h>	/* offsetof(), etc. */
@@ -459,7 +461,7 @@
 
 	if (conf->data_size && conf->data)
 	{
-		if(conf->data_size > 64000 || conf->data_size < 0){
+		if(conf->data_size > 128000 || conf->data_size < 0){
 			goto bail;
 		}
 		data = kmalloc(conf->data_size, GFP_KERNEL);
@@ -468,8 +470,7 @@
 			if(!copy_from_user(data, conf->data, conf->data_size))
 			{
 				conf->data=data;
-				wandev->setup(wandev,conf);
-				err = 0;
+				err = wandev->setup(wandev,conf);
 			}
 			else 
 				err = -ENOBUFS;
@@ -689,12 +690,10 @@
 	return 0;
 }
 
-#ifdef MODULE
 EXPORT_SYMBOL(register_wan_device);
 EXPORT_SYMBOL(unregister_wan_device);
 EXPORT_SYMBOL(wanrouter_encapsulate);
 EXPORT_SYMBOL(wanrouter_type_trans);
-#endif
 
 /*
  *	End

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov