Small Patch against 1.3.62

ecd@pool.informatik.rwth-aachen.de
Wed, 14 Feb 1996 12:40:56 +0100 (MET)


Hi,

I have a small patch against 1.3.62, which fixes the (known) if_slip.h
problem, and also:

- Add symbol 'scsi_mark_host_bus_reset' to scsi_syms. This one is used
by 'BusLogic.c', when built as a module.

- Add '#include <linux/mm.h>' (probably not the right place) to
fatfs_syms.c and msdosfs_syms.c, so genksyms can find all structs
when building with CONFIG_MODVERSIONS.

- This one is a more important one:

When building 'rarp.o' as module, the module should do an
MOD_INC_USE_COUNT for every address it has to serve, otherwise it
will be subject to autocleaning, which looses the addresses.
MOD_DEC_USE_COUNT is called for every freed address.

With all this, it is possible (and advisable, IMHO) to have af_inet.c
try to load "rarp", when it had not been installed, and CONFIG_KERNELD
is set.

I don't know, if this is the right place to send patches, so please
tell me the correct address if not.

Here comes the diff against 1.3.62:

(hope this is useful, Eddie)

diff -u -r linux-1.3.62/drivers/net/slip.c linux/drivers/net/slip.c
--- linux-1.3.62/drivers/net/slip.c Tue Feb 13 12:44:59 1996
+++ linux/drivers/net/slip.c Tue Feb 13 14:25:53 1996
@@ -76,6 +76,7 @@
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
+#include <linux/if_slip.h>
#include "slip.h"
#ifdef CONFIG_INET
#include <linux/ip.h>
diff -u -r linux-1.3.62/drivers/scsi/scsi_syms.c linux/drivers/scsi/scsi_syms.c
--- linux-1.3.62/drivers/scsi/scsi_syms.c Tue Feb 13 12:45:14 1996
+++ linux/drivers/scsi/scsi_syms.c Tue Feb 13 12:51:48 1996
@@ -61,6 +61,7 @@
X(need_isa_buffer),
X(request_queueable),
X(print_Scsi_Cmnd),
+ X(scsi_mark_host_bus_reset),
#if defined(CONFIG_PROC_FS)
X(proc_print_scsidevice),
#endif
diff -u -r linux-1.3.62/fs/fat/fatfs_syms.c linux/fs/fat/fatfs_syms.c
--- linux-1.3.62/fs/fat/fatfs_syms.c Tue Feb 13 12:44:35 1996
+++ linux/fs/fat/fatfs_syms.c Tue Feb 13 13:09:43 1996
@@ -6,6 +6,7 @@
*/
#include <linux/module.h>

+#include <linux/mm.h>
#include <linux/msdos_fs.h>

#include "msbuffer.h"
diff -u -r linux-1.3.62/fs/msdos/msdosfs_syms.c linux/fs/msdos/msdosfs_syms.c
--- linux-1.3.62/fs/msdos/msdosfs_syms.c Tue Feb 13 12:44:30 1996
+++ linux/fs/msdos/msdosfs_syms.c Tue Feb 13 13:10:01 1996
@@ -7,6 +7,7 @@

#include <linux/module.h>

+#include <linux/mm.h>
#include <linux/msdos_fs.h>

static struct symbol_table msdos_syms = {
diff -u -r linux-1.3.62/include/linux/if_slip.h linux/include/linux/if_slip.h
--- linux-1.3.62/include/linux/if_slip.h Tue Feb 13 12:44:41 1996
+++ linux/include/linux/if_slip.h Tue Feb 13 14:35:03 1996
@@ -20,7 +20,7 @@
*/

#define SIOCSKEEPALIVE (SIOCDEVPRIVATE) /* Set keepalive timeout in sec */
-#define SIOCGKEEPALIVE (SICODEVPRIVATE+1) /* Get keepalive timeout */
+#define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */
#define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */
#define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */

diff -u -r linux-1.3.62/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- linux-1.3.62/net/ipv4/af_inet.c Tue Feb 13 12:44:55 1996
+++ linux/net/ipv4/af_inet.c Tue Feb 13 12:48:06 1996
@@ -93,6 +93,9 @@
#ifdef CONFIG_IP_ALIAS
#include <net/ip_alias.h>
#endif
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif

#define min(a,b) ((a)<(b)?(a):(b))

@@ -1286,6 +1289,10 @@
case SIOCDRARP:
case SIOCGRARP:
case SIOCSRARP:
+#ifdef CONFIG_KERNELD
+ if (rarp_ioctl_hook == NULL)
+ request_module("rarp");
+#endif
if (rarp_ioctl_hook != NULL)
return(rarp_ioctl_hook(cmd,(void *) arg));
case SIOCGIFCONF:
diff -u -r linux-1.3.62/net/ipv4/rarp.c linux/net/ipv4/rarp.c
--- linux-1.3.62/net/ipv4/rarp.c Tue Feb 13 12:44:56 1996
+++ linux/net/ipv4/rarp.c Tue Feb 13 12:49:08 1996
@@ -105,6 +105,7 @@
static inline void rarp_release_entry(struct rarp_table *entry)
{
kfree_s(entry, sizeof(struct rarp_table));
+ MOD_DEC_USE_COUNT;
return;
}

@@ -370,6 +371,9 @@
entry->htype = htype;
memcpy(&entry->ha, &r.arp_ha.sa_data, hlen);
entry->dev = dev;
+
+ /* Don't unlink if we have entries to serve. */
+ MOD_INC_USE_COUNT;

sti();