summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2003-11-08 21:19:15 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2003-11-08 21:19:15 +0000
commitecc024c02e2f77786beb028380ed132f4d7edfca (patch)
treeea5b7c6443fc77118cc7fdc618b8595fbf5332d1
parentreconnect bg5pdf to the build system (diff)
Fix build on recent CURRENT
Submitted by: brooks Prodded by: Lukas Ertl
Notes
Notes: svn path=/head/; revision=93409
-rw-r--r--net/wmnet/files/patch-if.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/net/wmnet/files/patch-if.c b/net/wmnet/files/patch-if.c
new file mode 100644
index 000000000000..a2b10cddfc00
--- /dev/null
+++ b/net/wmnet/files/patch-if.c
@@ -0,0 +1,85 @@
+--- if.c.orig Sun Oct 11 19:13:16 1998
++++ if.c Fri Nov 22 16:24:50 2002
+@@ -88,8 +88,13 @@
+
+ if (!newData) {
+ size -= IF_STEP;
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ fprintf(stderr, "wmnet: Warning -- low memory; "
+ "ignoring %s interface\n", theData->if_name);
++#else
++ fprintf(stderr, "wmnet: Warning -- low memory; "
++ "ignoring %s interface\n", theData->if_xname);
++#endif
+ return 0;
+ }
+
+@@ -118,10 +123,13 @@
+ ptr->flags = 0;
+
+ #ifndef NDEBUG
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ printf("Added '%.*s%d' to list.\n", IFNAMSIZ, theData->if_name,
+ theData->if_unit);
++#else
++ printf("Added '%.*s' to list.\n", IFNAMSIZ, theData->if_xname);
++#endif
+ #endif
+-
+ // Bump the total.
+
+ ++total;
+@@ -144,7 +152,9 @@
+ {
+ static unsigned long c = 0;
+ static struct ifnet d;
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ static char name[IFNAMSIZ];
++#endif
+
+ /* If we are passed a NULL, the caller wants us to stop caching
+ the current interface. */
+@@ -161,6 +171,7 @@
+ return &d;
+ else if (sizeof(d) == kvm_read(kd, a, &d, sizeof(d))) {
+
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ /* We've read the structure's data, but the 'name' field still
+ points to kernel memory. We transfer the name to a local
+ buffer, and then modify the pointer to point to our
+@@ -172,6 +183,7 @@
+ if (sizeof(name) == n) {
+ name[IFNAMSIZ - 1] = '\0';
+ d.if_name = name;
++#endif
+ #ifndef NDEBUG
+
+ /* These are other pointer fields that we shouldn't need
+@@ -190,8 +202,10 @@
+ #endif
+ c = a;
+ return &d;
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ } else
+ return 0;
++#endif
+ } else
+ return 0;
+ }
+@@ -306,12 +320,16 @@
+ if (idx < total) {
+ struct ifnet const* const ptr = dereference(ifData[idx].ifNetAddr);
+
++#if defined(__FreeBSD__) && __FreeBSD_version < 501113
+ if (ptr) {
+ static char buffer[IFNAMSIZ + 1];
+
+ sprintf(buffer, "%.*s%d", IFNAMSIZ - 1, ptr->if_name, ptr->if_unit);
+ return buffer;
+ }
++#else
++ return ptr->if_xname;
++#endif
+ }
+ return 0;
+ }