Some enhancement to IPX as a module

Jacques Gelinas (jack@solucorp.qc.ca)
Tue, 7 May 1996 00:12:16 -0400 (EDT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

--2077098773-764907709-831442336=:981
Content-Type: TEXT/PLAIN; charset=US-ASCII

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.

--2077098773-764907709-831442336=:981
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="diff.1.3.97"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.3.91.960507001216.981F@486dos.solucorp.qc.ca>
Content-Description:

ZGlmZiAtcmMyUCBsaW51eC0xLjMuOTcvbmV0L2lweC9hZl9pcHguYyBsaW51
eC5uZXcvbmV0L2lweC9hZl9pcHguYw0KKioqIGxpbnV4LTEuMy45Ny9uZXQv
aXB4L2FmX2lweC5jCUZyaSBBcHIgMTIgMjM6MzY6MDcgMTk5Ng0KLS0tIGxp
bnV4Lm5ldy9uZXQvaXB4L2FmX2lweC5jCU1vbiBNYXkgIDYgMjI6MTg6MTUg
MTk5Ng0KKioqKioqKioqKioqKioqDQoqKiogNDUsNDggKioqKg0KLS0tIDQ1
LDU2IC0tLS0NCiAgICoJU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X0NPVU5UOw0KKyAJcmV0ID0gaXB4aXRmX2lvY3RsX3JlYWwgKGNtZCxh
cmcpOw0KKyAJTU9EX0RFQ19VU0VfQ09VTlQ7DQorIAlyZXR1cm4gcmV0Ow0K
KyB9DQogIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXA0KICAqCQkJCQkJ
CQkJCQkJCSAgICAgICAgICAgICoNCg==
--2077098773-764907709-831442336=:981--