summaryrefslogtreecommitdiff
path: root/security/skip/files/patch-bh
blob: b528ca23c257df689e9e2a0a55f719a5d220e396 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
diff -ur --unidirectional-new-file skipsrc-1.0.orig/skip/freebsd/skip_wrapper.c skipsrc-1.0/skip/freebsd/skip_wrapper.c
--- skipsrc-1.0.orig/skip/freebsd/skip_wrapper.c	Fri Oct 25 13:12:43 1996
+++ skipsrc-1.0/skip/freebsd/skip_wrapper.c	Mon Dec 22 12:48:43 1997
@@ -66,18 +66,7 @@
 #include <skip_es.h>
 #include <skip_if.h>
 
-
-/*
- * SunOS 4.1.x loadable driver wrapper for the SKIP module
- */
-extern char		skip_module_name[];
-
-/*
- * Module linkage information for the kernel.
- */
-extern int		nulldev();
-
-struct cfdriver skipcd=
+struct cfdriver skipcd =
         { NULL, "skip", NULL, NULL, DV_DULL, 0 };
 
 struct cdevsw skipdevsw = {
@@ -85,36 +74,55 @@
 	NULL, NULL, NULL, skip_ifselect, NULL, NULL 
 };
 
-MOD_DEV("skipmod", LM_DT_CHAR, -1, (void *)&skipdevsw)
+/* The following is necessary to work around a bug in versions
+   of FreeBSD's lkm.h up to and including 2.2.5 */
+
+#if __FreeBSD__ >= 2
+#include <osreldate.h>
+#if __FreeBSD_version <= 225000
+#define skip_module _module
+#endif
+#endif
+
+MOD_DEV(skip, LM_DT_CHAR, -1, (void *)&skipdevsw);
 
 extern int		skip_init(), skip_uninit();
 
 /*ARGSUSED*/
-int
-skipmod_load(struct lkm_table *lkmtp, int cmd)
+static int
+skip_load(struct lkm_table *lkmtp, int cmd)
 {
-
 	int rc;
+
 	rc = skip_init();
 	if (rc != 0) {
 		return (rc);
 	}
-	uprintf("skip: driver loaded\n");
+	log(LOG_INFO, "skip: driver loaded\n");
 	return (0);
 }
 
-skipmod_unload(struct lkm_table *lkmtp, int cmd)
+static int
+skip_unload(struct lkm_table *lkmtp, int cmd)
 {
-	
 	int rc;
+
 	rc = skip_uninit();
 	if (rc == 0) {
-		uprintf("skip: driver unloaded\n");
+		log(LOG_INFO, "skip: driver unloaded\n");
 	}
 	return (rc);
 }
 
-xxxinit(struct lkm_table *lkmtp, int cmd, int ver)
+static int
+skip_stat(struct lkm_table *lkmtp, int cmd)
+{
+	return(ENOSYS);
+}
+
+int
+skip(struct lkm_table *lkmtp, int cmd, int ver)
 {
-	DISPATCH(lkmtp, cmd, ver, skipmod_load, skipmod_unload, nosys);
+	MOD_DISPATCH(skip, lkmtp, cmd, ver, skip_load, skip_unload, skip_stat);
 }
+