lkml.org 
[lkml]   [1996]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSome enhancement to IPX as a module
Here is a patch to the IPX networking of Linux. When used as a module, 
with kerneld, the IPX modules was not properly managing the usage count.
For example, most IPX client machine will go with the simple

/sbin/ipx_configure --auto_interface=ON --auto_primary=ON

in the /etc/rc.d/... scripts. Later on, you should be able to do
things like ncpmount, or slist,... and access your novell server. The
ipx_configure command will automaticly load the IPX driver (kerneld) but
won't register any usage count so the module will be removed a minute
later (around that).

The following patch introduce the following changes.

-Setting --auto_interface=on increment the counter. Setting it to OFF
decrement it.
-Setting one interface (ipx_interface add eth0 802.2 53) will increment
it also. Removing one interface will decrement it.
-The ioctl operation are protected by a pair of usage count++, usage
count--. I have left unchanged the usage count associate with
sockets.

Here is the patch delivered as an attachement.


--------------------------------------------------------
Jacques Gelinas (jacques@solucorp.qc.ca)
Use Linux without reformating: Use UMSDOS.

diff -rc2P linux-1.3.97/net/ipx/af_ipx.c linux.new/net/ipx/af_ipx.c
*** linux-1.3.97/net/ipx/af_ipx.c Fri Apr 12 23:36:07 1996
--- linux.new/net/ipx/af_ipx.c Mon May 6 22:18:15 1996
***************
*** 45,48 ****
--- 45,56 ----
* Revision 0.35: Checksum support. <Neil Turton>, hooked in by <Alan Cox>
*
+ * Protect the module by a MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
+ * pair. Also, now usage count is managed this way
+ * -Count one if the auto_interface mode is on
+ * -Count one per configured interface
+ *
+ * Jacques Gelinas (jacques@solucorp.qc.ca)
+ *
+ *
* Portions Copyright (c) 1995 Caldera, Inc. <greg@caldera.com>
* Neither Greg Page nor Caldera, Inc. admit liability nor provide
***************
*** 106,110 ****
ipxcfg_set_auto_create(char val)
{
! ipxcfg_auto_create_interfaces = val;
return 0;
}
--- 114,125 ----
ipxcfg_set_auto_create(char val)
{
! if (ipxcfg_auto_create_interfaces != val){
! if (val){
! MOD_INC_USE_COUNT;
! }else{
! MOD_DEC_USE_COUNT;
! }
! ipxcfg_auto_create_interfaces = val;
! }
return 0;
}
***************
*** 337,340 ****
--- 352,356 ----
* - must be closed from user space
*/
+ MOD_DEC_USE_COUNT;
return;
}
***************
*** 804,807 ****
--- 820,824 ----
if (ipxcfg_auto_select_primary && (ipx_primary_net == NULL))
ipx_primary_net = intrfc;
+ MOD_INC_USE_COUNT;
return;
}
***************
*** 1016,1020 ****

static int
! ipxitf_ioctl(unsigned int cmd, void *arg)
{
int err;
--- 1033,1037 ----

static int
! ipxitf_ioctl_real(unsigned int cmd, void *arg)
{
int err;
***************
*** 1081,1084 ****
--- 1098,1110 ----
}

+ static int
+ ipxitf_ioctl(unsigned int cmd, void *arg)
+ {
+ int ret;
+ MOD_INC_USE_COUNT;
+ ret = ipxitf_ioctl_real (cmd,arg);
+ MOD_DEC_USE_COUNT;
+ return ret;
+ }
/*******************************************************************************************************************\
* *
\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.037 / U:2.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site