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
|
$NetBSD: patch-ac,v 1.3 2001/06/30 09:55:57 wiz Exp $
--- drivers.c.orig Fri May 5 02:34:29 2000
+++ drivers.c
@@ -57,7 +57,7 @@
#define ACCOUNT_IN_FOUND 1
#define ACCOUNT_OUT_FOUND 2
-extern char buffer[256];
+extern char buffer[2048];
extern char *in_rule_string, *out_rule_string, *device;
extern unsigned long totalbytes_in, totalbytes_out, lastbytes_in, lastbytes_out;
extern unsigned long totalpackets_in, totalpackets_out, lastpackets_in, lastpackets_out;
@@ -445,7 +445,7 @@
if (((kvmfd = kvm_open(NULL, NULL, NULL, O_RDONLY, buffer)) == NULL) ||
(kvm_nlist(kvmfd, symbols) < 0) ||
kvm_read(kvmfd, (unsigned long)symbols[0].n_value, &ifnet_savedaddr, sizeof(unsigned long)) == -1 ) return False;
- if(device == NULL) device = "ec0";
+ if(device == NULL) device = "ppp0";
fprintf(stderr, "wmnet: using kmem driver to monitor %s\n", device);
return True;
}
@@ -457,7 +457,7 @@
int flag = 0;
while (ifnet_addr && flag != (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND)) {
kvm_read(kvmfd, ifnet_addr, buffer, sizeof(struct ifnet));
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
snprintf(devname, 15, "%s", ifnet->if_xname);
#else
kvm_read(kvmfd, (unsigned long)ifnet->if_name, devname, 15);
@@ -487,7 +487,7 @@
flag = (ACCOUNT_IN_FOUND|ACCOUNT_OUT_FOUND);
} else {
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
ifnet_addr = (unsigned long)ifnet->if_list.tqe_next;
#else
ifnet_addr = (unsigned long)ifnet->if_next;
|