[Glibc-bsd-commits] r4047 - in trunk/freebsd-utils/debian: . local/include/sys patches

Robert Millan rmh at alioth.debian.org
Tue Jan 31 19:21:26 UTC 2012


Author: rmh
Date: 2012-01-31 19:21:24 +0000 (Tue, 31 Jan 2012)
New Revision: 4047

Added:
   trunk/freebsd-utils/debian/patches/ifconfig_nojail.diff
   trunk/freebsd-utils/debian/patches/pf_regex_c.diff
   trunk/freebsd-utils/debian/patches/pf_regex_followup.diff
   trunk/freebsd-utils/debian/patches/pf_regex_h.diff
   trunk/freebsd-utils/debian/patches/savecore_signal.diff
   trunk/freebsd-utils/debian/patches/tmp_glibc.diff
Removed:
   trunk/freebsd-utils/debian/local/include/sys/cdefs.h
   trunk/freebsd-utils/debian/patches/000_devd_usb.diff
   trunk/freebsd-utils/debian/patches/001_unused.diff
   trunk/freebsd-utils/debian/patches/005_ktrace.diff
   trunk/freebsd-utils/debian/patches/012_mount_std.diff
   trunk/freebsd-utils/debian/patches/037_mount_autofs.diff
   trunk/freebsd-utils/debian/patches/040_kdump_multiarch.diff
Modified:
   trunk/freebsd-utils/debian/changelog
   trunk/freebsd-utils/debian/control
   trunk/freebsd-utils/debian/freebsd-utils.install
   trunk/freebsd-utils/debian/freebsd-utils.manpages
   trunk/freebsd-utils/debian/local/include/sys/mount.h
   trunk/freebsd-utils/debian/patches/001_dmesg.diff
   trunk/freebsd-utils/debian/patches/002_ifconfig.diff
   trunk/freebsd-utils/debian/patches/003_kbdcontrol.diff
   trunk/freebsd-utils/debian/patches/004_kldconfig.diff
   trunk/freebsd-utils/debian/patches/006_mdconfig.diff
   trunk/freebsd-utils/debian/patches/007_mount.diff
   trunk/freebsd-utils/debian/patches/013_pf.diff
   trunk/freebsd-utils/debian/patches/014_route.diff
   trunk/freebsd-utils/debian/patches/016_swapon.diff
   trunk/freebsd-utils/debian/patches/017_sysctl.diff
   trunk/freebsd-utils/debian/patches/018_umount.diff
   trunk/freebsd-utils/debian/patches/021_netstat.diff
   trunk/freebsd-utils/debian/patches/022_devd.diff
   trunk/freebsd-utils/debian/patches/024_devfs.diff
   trunk/freebsd-utils/debian/patches/025_camcontrol.diff
   trunk/freebsd-utils/debian/patches/026_kdump.diff
   trunk/freebsd-utils/debian/patches/027_pppctl.diff
   trunk/freebsd-utils/debian/patches/028_vidcontrol.diff
   trunk/freebsd-utils/debian/patches/029_arp.diff
   trunk/freebsd-utils/debian/patches/031_savecore.diff
   trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff
   trunk/freebsd-utils/debian/patches/035_nfs.diff
   trunk/freebsd-utils/debian/patches/036_nfs_glibc.diff
   trunk/freebsd-utils/debian/patches/038_jail.diff
   trunk/freebsd-utils/debian/patches/039_geom.diff
   trunk/freebsd-utils/debian/patches/043_ppp.diff
   trunk/freebsd-utils/debian/patches/044_mount_exec.diff
   trunk/freebsd-utils/debian/patches/series
   trunk/freebsd-utils/debian/rules
Log:
New upstream release

Modified: trunk/freebsd-utils/debian/changelog
===================================================================
--- trunk/freebsd-utils/debian/changelog	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/changelog	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,10 +1,13 @@
-freebsd-utils (8.2+ds3-3) UNRELEASED; urgency=low
+freebsd-utils (9.0-1) UNRELEASED; urgency=low
 
+  * New upstream release.
+
+  [ Robert Millan ]
   * devd.init: Add /usr/sbin:/usr/bin to PATH (needed for
     /usr/bin/logger).
   * Split mkuzip into its own package.
 
- -- Robert Millan <rmh at debian.org>  Sat, 17 Dec 2011 11:14:44 +0000
+ -- Robert Millan <rmh at debian.org>  Tue, 17 Jan 2012 15:29:57 +0100
 
 freebsd-utils (8.2+ds3-2) unstable; urgency=high
 

Modified: trunk/freebsd-utils/debian/control
===================================================================
--- trunk/freebsd-utils/debian/control	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/control	2012-01-31 19:21:24 UTC (rev 4047)
@@ -3,15 +3,16 @@
 Priority: important
 Maintainer: GNU/kFreeBSD Maintainers <debian-bsd at lists.debian.org>
 Uploaders: Aurelien Jarno <aurel32 at debian.org>, Guillem Jover <guillem at debian.org>, Robert Millan <rmh at debian.org>
-Build-Depends: debhelper (>= 7), po-debconf, freebsd-buildutils, sharutils,
+Build-Depends: debhelper (>= 7), po-debconf, sharutils,
  flex | flex-old,
- kfreebsd-kernel-headers (>= 0.56),
+ freebsd-buildutils (>= 9.0-3), 
+ kfreebsd-kernel-headers (>= 0.70),
  libc0.1-dev (>= 2.13-11),
  libbsd-dev (>= 0.3.0), pkg-config,
 # zlib1g-dev: savecore
  zlib1g-dev,
 # libkvm-dev: dmesg
- libkvm-dev (>= 8.2),
+ libkvm-dev (>= 8.3~),
  libmemstat-dev,
  libnetgraph-dev,
 # libipx-dev: ifconfig
@@ -32,7 +33,7 @@
  libexpat1-dev,
 # libtirpc-dev: mount_nfs, mountd, nfsd, rpc.lockd, rpc.statd
  libtirpc-dev,
-# libjail-dev: jail
+# libjail-dev: jail, ifconfig
  libjail-dev,
 # libssl-dev: geom
  libssl-dev,

Modified: trunk/freebsd-utils/debian/freebsd-utils.install
===================================================================
--- trunk/freebsd-utils/debian/freebsd-utils.install	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/freebsd-utils.install	2012-01-31 19:21:24 UTC (rev 4047)
@@ -18,7 +18,6 @@
 sbin/ccdconfig/ccdconfig		/sbin
 sbin/mdconfig/mdconfig			/sbin
 sbin/mount_std/mount_std		/sbin
-sbin/mount_autofs/mount_autofs		/sbin
 sbin/mount_cd9660/mount_cd9660		/sbin
 sbin/mount_ext2fs/mount_ext2fs		/sbin
 sbin/mount_hpfs/mount_hpfs		/sbin

Modified: trunk/freebsd-utils/debian/freebsd-utils.manpages
===================================================================
--- trunk/freebsd-utils/debian/freebsd-utils.manpages	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/freebsd-utils.manpages	2012-01-31 19:21:24 UTC (rev 4047)
@@ -6,7 +6,6 @@
 sbin/dmesg/dmesg.8
 sbin/dumpon/dumpon.8
 sbin/mdconfig/mdconfig.8
-sbin/mount_autofs/mount_autofs.8
 sbin/mount_cd9660/mount_cd9660.8
 sbin/mount_ext2fs/mount_ext2fs.8
 sbin/mount_hpfs/mount_hpfs.8

Deleted: trunk/freebsd-utils/debian/local/include/sys/cdefs.h
===================================================================
--- trunk/freebsd-utils/debian/local/include/sys/cdefs.h	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/local/include/sys/cdefs.h	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,3 +0,0 @@
-#include_next <sys/cdefs.h>
-#include <stdint.h>
-#define __DECONST(type, var)	((type) var)

Modified: trunk/freebsd-utils/debian/local/include/sys/mount.h
===================================================================
--- trunk/freebsd-utils/debian/local/include/sys/mount.h	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/local/include/sys/mount.h	2012-01-31 19:21:24 UTC (rev 4047)
@@ -7,6 +7,10 @@
 #undef export_args
 #undef oexport_args
 
+#ifndef MNT_SUJ
+#define     MNT_SUJ         0x0000000100000000ULL /* using journaled soft updates */
+#endif
+
 /*
  * Old export arguments without security flavor list
  */

Deleted: trunk/freebsd-utils/debian/patches/000_devd_usb.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/000_devd_usb.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/000_devd_usb.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,4275 +0,0 @@
-
-usb.conf obtained from 8-STABLE:
-
-  svn cat http://svn.freebsd.org/base/stable/8/etc/devd/usb.conf
-
---- /dev/null
-+++ b/etc/devd/usb.conf
-@@ -0,0 +1,4267 @@
-+#
-+# $FreeBSD$
-+#
-+# This file was automatically generated by "tools/bus_autoconf.sh".
-+# Please do not edit!
-+#
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "0x1290";
-+	match "intclass" "0xff";
-+	match "intsubclass" "0xfd";
-+	match "intprotocol" "0x01";
-+	action "kldload if_ipheth";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "0x1292";
-+	match "intclass" "0xff";
-+	match "intsubclass" "0xfd";
-+	match "intprotocol" "0x01";
-+	action "kldload if_ipheth";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "0x1294";
-+	match "intclass" "0xff";
-+	match "intsubclass" "0xfd";
-+	match "intprotocol" "0x01";
-+	action "kldload if_ipheth";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "0x1297";
-+	match "intclass" "0xff";
-+	match "intsubclass" "0xfd";
-+	match "intprotocol" "0x01";
-+	action "kldload if_ipheth";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0104";
-+	match "product" "0x00be";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0123";
-+	match "product" "0x0001";
-+	action "kldload uep";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03e8";
-+	match "product" "0x0008";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03eb";
-+	match "product" "0x2109";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "0x0121";
-+	action "kldload ugensa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "(0x1016|0x1116|0x1216)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "(0x1b1d|0x1e1d)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "0x3524";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "0x811c";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x03f0";
-+	match "product" "0xca02";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0402";
-+	match "product" "0x5632";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0403";
-+	match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0408";
-+	match "product" "0x0304";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0408";
-+	match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0409";
-+	match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "(0x0001|0x0005|0x0009)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x0012";
-+	action "kldload if_rue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x003d";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "(0x005e|0x0066|0x0067)";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x006e";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x008b";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x00b3";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "(0x00d8|0x00d9)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x00da";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x00e8";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "(0x0116|0x0119)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x012e";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "0x0137";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0411";
-+	match "product" "(0x0148|0x0150|0x015d|0x016f)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0413";
-+	match "product" "0x2101";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0423";
-+	match "product" "(0x000a|0x000c)";
-+	action "kldload if_cue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x043e";
-+	match "product" "0x9c01";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x045a";
-+	match "product" "(0x5001|0x5002)";
-+	action "kldload urio";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x045b";
-+	match "product" "0x0053";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x045e";
-+	match "product" "0x0079";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x045e";
-+	match "product" "0x007a";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x045e";
-+	match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0471";
-+	match "product" "0x066a";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0471";
-+	match "product" "0x1236";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0471";
-+	match "product" "0x200f";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0482";
-+	match "product" "0x0203";
-+	action "kldload umodem";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0489";
-+	match "product" "(0xe000|0xe003)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x049f";
-+	match "product" "(0x0003|0x0032)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x049f";
-+	match "product" "0x505a";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04a4";
-+	match "product" "0x0014";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04a5";
-+	match "product" "0x4027";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04a5";
-+	match "product" "0x4068";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04ad";
-+	match "product" "(0x0301|0x0302|0x0303|0x0306)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04b4";
-+	match "product" "0x1002";
-+	action "kldload ufm";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04b7";
-+	match "product" "0x0531";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04b8";
-+	match "product" "(0x0521|0x0522)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bb";
-+	match "product" "0x0901";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bb";
-+	match "product" "(0x0904|0x0913)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bb";
-+	match "product" "0x0930";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bb";
-+	match "product" "(0x0944|0x0945|0x0947|0x0948)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bb";
-+	match "product" "(0x0a03|0x0a0e)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04bf";
-+	match "product" "(0x0115|0x0117)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04c5";
-+	match "product" "(0x1058|0x1079)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04da";
-+	match "product" "0x2500";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04da";
-+	match "product" "0x3900";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04dd";
-+	match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031)";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04dd";
-+	match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04e8";
-+	match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04e8";
-+	match "product" "0x6601";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04e8";
-+	match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04e8";
-+	match "product" "0x8001";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04f1";
-+	match "product" "0x3008";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x04f1";
-+	match "product" "(0x3011|0x3012)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0502";
-+	match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0506";
-+	match "product" "(0x03e8|0x11f8)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0506";
-+	match "product" "0x4601";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x0103";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x0109";
-+	action "kldload umct";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x0121";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x0257";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x0409";
-+	action "kldload umct";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x1203";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x4050";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x5055";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x7050";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "(0x7050|0x7051)";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x705a";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x705c";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x705e";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "(0x8053|0x805c|0x815c|0x825a)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x905b";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x050d";
-+	match "product" "0x935a";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0525";
-+	match "product" "0x1080";
-+	action "kldload udbp";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0525";
-+	match "product" "0xa4a2";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0536";
-+	match "product" "0x01a0";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0543";
-+	match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0547";
-+	match "product" "0x2008";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0547";
-+	match "product" "0x2720";
-+	action "kldload udbp";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x054c";
-+	match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169)";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x054c";
-+	match "product" "0x0437";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0557";
-+	match "product" "0x2002";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0557";
-+	match "product" "0x2007";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0557";
-+	match "product" "0x2008";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0557";
-+	match "product" "0x2009";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0557";
-+	match "product" "0x4000";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x055d";
-+	match "product" "0x2018";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0565";
-+	match "product" "0x0001";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0565";
-+	match "product" "(0x0002|0x0003|0x0005)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0567";
-+	match "product" "(0x2000|0x2002)";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x056c";
-+	match "product" "0x8007";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x056e";
-+	match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x056e";
-+	match "product" "(0x5003|0x5004)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x056e";
-+	match "product" "0xabc1";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x057c";
-+	match "product" "(0x2200|0x3800)";
-+	action "kldload ng_ubt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0584";
-+	match "product" "0xb000";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0584";
-+	match "product" "0xb020";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0586";
-+	match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0586";
-+	match "product" "(0x3416|0x341a)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x058f";
-+	match "product" "0x9720";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05a6";
-+	match "product" "0x0101";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b)";
-+	action "kldload atp";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ac";
-+	match "product" "0x1402";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05ad";
-+	match "product" "0x0fba";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05c6";
-+	match "product" "(0x6000|0x6613)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05cc";
-+	match "product" "0x3000";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05db";
-+	match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)";
-+	action "kldload uvscom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05e0";
-+	match "product" "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05e3";
-+	match "product" "0x0501";
-+	action "kldload udbp";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x05e9";
-+	match "product" "(0x0008|0x0009)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x066b";
-+	match "product" "(0x200c|0x2202)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x066b";
-+	match "product" "0x2202";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x066b";
-+	match "product" "(0x2203|0x2204|0x2206|0x400b)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0675";
-+	match "product" "0x0550";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067b";
-+	match "product" "(0x0000|0x0001)";
-+	action "kldload udbp";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067b";
-+	match "product" "(0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067b";
-+	match "product" "0x2501";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067b";
-+	match "product" "(0x331a|0xaaa0|0xaaa2)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067c";
-+	match "product" "0x1001";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x067e";
-+	match "product" "0x1001";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0681";
-+	match "product" "0x3c06";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x06e1";
-+	match "product" "(0x0008|0x0009)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x06f8";
-+	match "product" "0xe000";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x06f8";
-+	match "product" "(0xe010|0xe020)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x06f8";
-+	match "product" "0xe030";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0707";
-+	match "product" "0x0100";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0707";
-+	match "product" "(0x0200|0x0201)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0707";
-+	match "product" "0xee13";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0707";
-+	match "product" "0xee13";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0711";
-+	match "product" "(0x0200|0x0210|0x0230)";
-+	action "kldload umct";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0731";
-+	match "product" "(0x0528|0x2003)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0745";
-+	match "product" "0x0001";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0745";
-+	match "product" "0x1000";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0769";
-+	match "product" "0x11f2";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0769";
-+	match "product" "0x11f3";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0769";
-+	match "product" "0x31f3";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x077b";
-+	match "product" "0x2226";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0789";
-+	match "product" "0x010c";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0789";
-+	match "product" "0x0160";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0789";
-+	match "product" "(0x0162|0x0163|0x0164)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x078b";
-+	match "product" "0x1234";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x079b";
-+	match "product" "0x0027";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x079b";
-+	match "product" "(0x004a|0x0062)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07a6";
-+	match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "0x0001";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "(0x0004|0x000d)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "0x0017";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "0x002a";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "(0x002d|0x002e)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "(0x002f|0x003c|0x003f|0x0041|0x0042)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07aa";
-+	match "product" "0x9601";
-+	action "kldload if_udav";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "(0x110c|0x200c)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "0x4000";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "(0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "0x420a";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "0x6001";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "0xabc1";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07b8";
-+	match "product" "(0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07c9";
-+	match "product" "0xb100";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07cf";
-+	match "product" "(0x2001|0x2002|0x2003)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07d1";
-+	match "product" "0x3a0c";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07d1";
-+	match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x07d1";
-+	match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x081e";
-+	match "product" "0xdf00";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x082d";
-+	match "product" "(0x0100|0x0200|0x0300)";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0830";
-+	match "product" "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0833";
-+	match "product" "(0x012e|0x039f)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "0x1046";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "(0x4505|0x4506)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "0x4508";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "0x4521";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "0x5046";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "(0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x083a";
-+	match "product" "0xe501";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0841";
-+	match "product" "0x0001";
-+	action "kldload urio";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "(0x1001|0x1002)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "0x1020";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "0x1040";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "0x4240";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "0x4260";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "0x4300";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0846";
-+	match "product" "(0x6100|0x6a00)";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0856";
-+	match "product" "0xac01";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x085a";
-+	match "product" "(0x0008|0x0009)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x086e";
-+	match "product" "0x1920";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x087d";
-+	match "product" "0x5704";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08d1";
-+	match "product" "0x0001";
-+	action "kldload if_cue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08d1";
-+	match "product" "0x0003";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08dd";
-+	match "product" "(0x0986|0x0987|0x0988|0x8511)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08dd";
-+	match "product" "0x90ff";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08e6";
-+	match "product" "0x5501";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x08fd";
-+	match "product" "0x000a";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0915";
-+	match "product" "(0x2000|0x2002)";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x091e";
-+	match "product" "0x0004";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0921";
-+	match "product" "0x1001";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0930";
-+	match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0930";
-+	match "product" "0x0a07";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0930";
-+	match "product" "(0x0d45|0x1302)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x093c";
-+	match "product" "(0x0601|0x0701)";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x094b";
-+	match "product" "0x0001";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0951";
-+	match "product" "0x0008";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0951";
-+	match "product" "0x000a";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x095a";
-+	match "product" "0x3003";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0960";
-+	match "product" "(0x0065|0x0066|0x0067)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0961";
-+	match "product" "0x0010";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x099e";
-+	match "product" "(0x0052|0x4000)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x09aa";
-+	match "product" "0x1000";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x09d7";
-+	match "product" "0x0100";
-+	action "kldload ugensa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0a46";
-+	match "product" "(0x0268|0x8515|0x9601)";
-+	action "kldload if_udav";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0a5c";
-+	match "product" "0x2033";
-+	action "kldload ubtbcmfw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0ace";
-+	match "product" "(0x1211|0x1215)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x6911";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x6971";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x6971";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x7001";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x7011";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "(0x7021|0x7041|0x7061|0x7100|0x7201|0x7211)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "(0x7251|0x7301|0x7361|0x7381|0x7401|0x7501)";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0x7601";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "(0x7601|0xc031|0xd013|0xd031)";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "0xd033";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0af0";
-+	match "product" "(0xd033|0xd055|0xd055)";
-+	action "kldload uhso";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "(0x1706|0x1707)";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "(0x170c|0x171b)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "0x171d";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "(0x1723|0x1724)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "(0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b05";
-+	match "product" "(0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b39";
-+	match "product" "0x0109";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b39";
-+	match "product" "0x0421";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b3b";
-+	match "product" "(0x1630|0x5630|0x6630)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b41";
-+	match "product" "0x0011";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b63";
-+	match "product" "0x6530";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b8c";
-+	match "product" "0x2303";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0b95";
-+	match "product" "(0x1720|0x1780|0x7720|0x772a)";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0baf";
-+	match "product" "0x0118";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0baf";
-+	match "product" "0x0121";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bb2";
-+	match "product" "0x6098";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bb4";
-+	match "product" "(0x00ce|0x00cf|0x00cf|0x0a01|0x0a02|0x0a03|0x0a04|0x0a05|0x0a06|0x0a07|0x0a08|0x0a09|0x0a0a|0x0a0b|0x0a0c|0x0a0d|0x0a0e|0x0a0f|0x0a10|0x0a11|0x0a12|0x0a13|0x0a14|0x0a15|0x0a16|0x0a17|0x0a18|0x0a19|0x0a1a|0x0a1b|0x0a1c|0x0a1d|0x0a1e|0x0a1f|0x0a20|0x0a21|0x0a22|0x0a23|0x0a24|0x0a25|0x0a26|0x0a27|0x0a28|0x0a29|0x0a2a|0x0a2b|0x0a2c|0x0a2d|0x0a2e|0x0a2f|0x0a30|0x0a31|0x0a32|0x0a33|0x0a34|0x0a35|0x0a36|0x0a37|0x0a38|0x0a39|0x0a3a|0x0a3b|0x0a3c|0x0a3d|0x0a3e|0x0a3f|0x0a40|0x0a41|0x0a42|0x0a43|0x0a44|0x0a45|0x0a46|0x0a47|0x0a48|0x0a49|0x0a4a|0x0a4b|0x0a4c|0x0a4d|0x0a4e|0x0a4f|0x0a50|0x0a51|0x0a52|0x0a53|0x0a54|0x0a55|0x0a56|0x0a57|0x0a58|0x0a59|0x0a5a|0x0a5b|0x0a5c|0x0a5d|0x0a5e|0x0a5f|0x0a60|0x0a61|0x0a62|0x0a63|0x0a64|0x0a65|0x0a66|0x0a67|0x0a68|0x0a69|0x0a6a|0x0a6b|0x0a6c|0x0a6d|0x0a6e|0x0a6f|0x0a70|0x0a71|0x0a72|0x0a73|0x0a74|0x0a75|0x0a76|0x0a77|0x0a78|0x0a79|0x0a7a|0x0a7b|0x0a7c|0x0a7d|0x0a7e|0x0a7f|0x0a80|0x0a81|0x0a82|0x0a83|0x0a84|0x0a85|0x0a86|0x0a87|0x0a88|0x0a89|0x0a8a|0x0a8b|0x0a8c|0x0a8d|0x0a8e|0x0a8f|0x0a90|0x0a91|0x0a92|0x0a93|0x0a94|0x0a95|0x0a96|0x0a97|0x0a98|0x0a99|0x0a9a|0x0a9b|0x0a9c|0x0a9d|0x0a9e|0x0a9f|0x0bce)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bda";
-+	match "product" "0x8150";
-+	action "kldload if_rue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bda";
-+	match "product" "(0x8187|0x8189|0x8197|0x8198)";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bed";
-+	match "product" "(0x1100|0x1101)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bf8";
-+	match "product" "0x1001";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0bf8";
-+	match "product" "0x1009";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0c44";
-+	match "product" "0x03a2";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0c88";
-+	match "product" "0x17da";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0c88";
-+	match "product" "0x17da";
-+	action "kldload ugensa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0c88";
-+	match "product" "0x180a";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0c8e";
-+	match "product" "0x6000";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cad";
-+	match "product" "0x9001";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "0x0008";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "0x0011";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "0x0012";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "0x0015";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "0x001a";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cde";
-+	match "product" "(0x0022|0x0025)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0cf3";
-+	match "product" "(0x0001|0x0003|0x0005)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0d8e";
-+	match "product" "0x3762";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0d8e";
-+	match "product" "(0x7801|0x7811)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db0";
-+	match "product" "(0x3820|0x3821|0x3822|0x3870|0x3871)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db0";
-+	match "product" "(0x6861|0x6865|0x6869)";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db0";
-+	match "product" "(0x6874|0x6877)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db0";
-+	match "product" "(0x6899|0x821a|0x822a|0x870a|0x871a|0x899a)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db0";
-+	match "product" "(0xa861|0xa874)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0db7";
-+	match "product" "0x0002";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "0x000d";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "0x0017";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "0x0021";
-+	action "kldload if_mos";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "0x0028";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "(0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "0x061c";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "(0x9071|0x9075)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df6";
-+	match "product" "(0x90ac|0x9712)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0df7";
-+	match "product" "0x0620";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e0b";
-+	match "product" "(0x9031|0x9041)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e55";
-+	match "product" "0x110b";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e66";
-+	match "product" "(0x0001|0x0003|0x0009|0x000b)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e66";
-+	match "product" "0x400c";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e67";
-+	match "product" "0x0002";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0e7e";
-+	match "product" "0x1001";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0ea0";
-+	match "product" "0x6858";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0eab";
-+	match "product" "0xc893";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0eb0";
-+	match "product" "0x9020";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0eb0";
-+	match "product" "0x9021";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0eba";
-+	match "product" "(0x1080|0x2080)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0eef";
-+	match "product" "(0x0001|0x0002)";
-+	action "kldload uep";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f3d";
-+	match "product" "0x0112";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f3d";
-+	match "product" "0x0112";
-+	action "kldload ugensa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f4e";
-+	match "product" "0x0200";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f88";
-+	match "product" "0x3012";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f88";
-+	match "product" "0x3014";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f94";
-+	match "product" "0x0001";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0f98";
-+	match "product" "0x0201";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0fb8";
-+	match "product" "(0x3001|0x3002|0x3003|0x4001)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0fcf";
-+	match "product" "(0x1003|0x1004|0x1006)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x0fe6";
-+	match "product" "(0x8101|0x9700)";
-+	action "kldload if_udav";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x100d";
-+	match "product" "(0x9031|0x9032)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1011";
-+	match "product" "0x3198";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1044";
-+	match "product" "0x8001";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1044";
-+	match "product" "0x8002";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1044";
-+	match "product" "0x8007";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1044";
-+	match "product" "(0x8008|0x800a)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1044";
-+	match "product" "(0x800b|0x800c|0x800d)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1066";
-+	match "product" "(0x00ce|0x0300|0x0500|0x0600|0x0700)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x106c";
-+	match "product" "0x3701";
-+	action "kldload umodem";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10a6";
-+	match "product" "0xaa26";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10ab";
-+	match "product" "0x10c5";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10b5";
-+	match "product" "0xac70";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10b5";
-+	match "product" "0xac70";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10bd";
-+	match "product" "0x1427";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10c4";
-+	match "product" "(0x0f91|0x1101|0x1601|0x800a|0x803b|0x8043|0x8044)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10c4";
-+	match "product" "0x8053";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10c4";
-+	match "product" "(0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10c5";
-+	match "product" "0xea61";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x10ce";
-+	match "product" "0xea61";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1114";
-+	match "product" "(0x0001|0x0004|0x0006)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x114b";
-+	match "product" "0x0110";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x114b";
-+	match "product" "0x0150";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1163";
-+	match "product" "0x0100";
-+	action "kldload ucycom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1182";
-+	match "product" "0x1388";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1186";
-+	match "product" "0x3e04";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1189";
-+	match "product" "0x0893";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1199";
-+	match "product" "(0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0112|0x0120|0x0218)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1199";
-+	match "product" "0x0218";
-+	action "kldload umodem";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1199";
-+	match "product" "(0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x11ad";
-+	match "product" "0x0701";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x11d9";
-+	match "product" "(0x1002|0x1003)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x11f5";
-+	match "product" "(0x0001|0x0003|0x0004|0x0005)";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x11f6";
-+	match "product" "0x2001";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x11f7";
-+	match "product" "0x02df";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1231";
-+	match "product" "(0xce01|0xce02)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x126f";
-+	match "product" "0xa006";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x129b";
-+	match "product" "0x1666";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x129b";
-+	match "product" "0x1828";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x12d1";
-+	match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x12ef";
-+	match "product" "0x0100";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1342";
-+	match "product" "0x0204";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1371";
-+	match "product" "(0x9022|0x9032)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1371";
-+	match "product" "0x9401";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1385";
-+	match "product" "(0x4250|0x5f00|0x5f02)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13ad";
-+	match "product" "0x9999";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "0x000c";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "(0x000d|0x0011)";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "0x0018";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "0x001a";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "(0x0020|0x0023)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13b1";
-+	match "product" "0x0024";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13d2";
-+	match "product" "0x0400";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x13d3";
-+	match "product" "(0x3247|0x3262|0x3273|0x3284|0x3305)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1410";
-+	match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5100|0x6000|0x6002|0x7042)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1416";
-+	match "product" "0x1110";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1435";
-+	match "product" "0x0427";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1435";
-+	match "product" "0x0711";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1435";
-+	match "product" "(0x0826|0x082a)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1453";
-+	match "product" "0x4026";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1472";
-+	match "product" "0x0009";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1482";
-+	match "product" "0x3c09";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1485";
-+	match "product" "(0x0001|0x0002)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "0x1706";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "0x2070";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "0x2570";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "(0x2573|0x2671)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "0x9020";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x148f";
-+	match "product" "0x9021";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14b2";
-+	match "product" "0x3c02";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14b2";
-+	match "product" "(0x3c06|0x3c07|0x3c08|0x3c09|0x3c11|0x3c12)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14b2";
-+	match "product" "0x3c22";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14b2";
-+	match "product" "(0x3c23|0x3c25|0x3c25|0x3c27|0x3c28)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14ea";
-+	match "product" "0xab10";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14ea";
-+	match "product" "0xab11";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x14ea";
-+	match "product" "0xab13";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1555";
-+	match "product" "0x0004";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1557";
-+	match "product" "0x7720";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1557";
-+	match "product" "0x8150";
-+	action "kldload if_rue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x157e";
-+	match "product" "0x3006";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x157e";
-+	match "product" "(0x300a|0x300b|0x300d)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x157e";
-+	match "product" "0x300e";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x157e";
-+	match "product" "0x3204";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x157e";
-+	match "product" "0x3205";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1582";
-+	match "product" "0x6003";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x15a9";
-+	match "product" "0x0004";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x15a9";
-+	match "product" "(0x0006|0x0010)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x15c5";
-+	match "product" "0x0008";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x15e8";
-+	match "product" "(0x9100|0x9110)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1614";
-+	match "product" "(0x0800|0x0802|0x7002)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1631";
-+	match "product" "0x6200";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1631";
-+	match "product" "0xc019";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1645";
-+	match "product" "(0x0005|0x0008|0x8005)";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x166a";
-+	match "product" "0x0303";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x167b";
-+	match "product" "0x4001";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x168c";
-+	match "product" "0x0001";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1690";
-+	match "product" "0x0601";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1690";
-+	match "product" "(0x0710|0x0712)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1690";
-+	match "product" "0x0722";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1690";
-+	match "product" "(0x0740|0x0744)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16ab";
-+	match "product" "(0x7801|0x7811)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d5";
-+	match "product" "(0x6202|0x6501)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d5";
-+	match "product" "0x6501";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d5";
-+	match "product" "0x6502";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d5";
-+	match "product" "0x6502";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d6";
-+	match "product" "(0x0001|0x0001)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d8";
-+	match "product" "(0x6006|0x6280)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16d8";
-+	match "product" "0x6280";
-+	action "kldload ugensa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x16dc";
-+	match "product" "(0x0010|0x0011|0x0012|0x0015)";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1726";
-+	match "product" "0x1000";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1726";
-+	match "product" "0x1000";
-+	action "kldload ubsa";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1737";
-+	match "product" "0x0039";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1737";
-+	match "product" "(0x0070|0x0071)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1737";
-+	match "product" "0x0073";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1737";
-+	match "product" "(0x0077|0x0078|0x0079)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1740";
-+	match "product" "(0x0605|0x0615)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1740";
-+	match "product" "0x2000";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1740";
-+	match "product" "(0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1761";
-+	match "product" "0x0b05";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x177f";
-+	match "product" "(0x0153|0x0302|0x0313)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x17f4";
-+	match "product" "0xaaaa";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1843";
-+	match "product" "0x0200";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18c5";
-+	match "product" "0x0002";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18c5";
-+	match "product" "(0x0008|0x0012)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18e8";
-+	match "product" "(0x6196|0x6229)";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18e8";
-+	match "product" "0x6232";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18e8";
-+	match "product" "0x6238";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18e8";
-+	match "product" "0x6259";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x18ef";
-+	match "product" "0xe00f";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x19d2";
-+	match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1a86";
-+	match "product" "0x7523";
-+	action "kldload uchcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1a8d";
-+	match "product" "(0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100b|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1b3d";
-+	match "product" "0x0153";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1b75";
-+	match "product" "0x3072";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1b75";
-+	match "product" "0x8187";
-+	action "kldload if_urtw";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1bbb";
-+	match "product" "(0x0000|0xf000)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1bc7";
-+	match "product" "(0x1003|0x1004)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1be3";
-+	match "product" "0x07a6";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1c9e";
-+	match "product" "(0x6061|0x9603|0xf000)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1cf1";
-+	match "product" "(0x0001|0x0004)";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1d09";
-+	match "product" "0x4000";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1d4d";
-+	match "product" "(0x0002|0x000c|0x000e|0x0010)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1da5";
-+	match "product" "(0x4512|0x4515|0x4519|0x4523)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1e0e";
-+	match "product" "(0x9000|0x9200|0xce16)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x1eda";
-+	match "product" "0x2310";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "0x1a00";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "0x200c";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "(0x3a00|0x3a02|0x3a04)";
-+	action "kldload if_uath";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "0x3c00";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "0x3c05";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "(0x3c09|0x3c0a)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "0x4000";
-+	action "kldload if_kue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2001";
-+	match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "0x5303";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "0xab01";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "(0xab24|0xab25)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "0xab50";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "(0xc007|0xed01)";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "0xed02";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2019";
-+	match "product" "(0xed06|0xed14)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x203d";
-+	match "product" "(0x1480|0x14a1|0x14a9)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x20b8";
-+	match "product" "0x8888";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x20b9";
-+	match "product" "0x1682";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x22b8";
-+	match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x22b8";
-+	match "product" "(0x600c|0x6027)";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x2478";
-+	match "product" "0x2008";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x3334";
-+	match "product" "0x1701";
-+	action "kldload if_aue";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x3340";
-+	match "product" "(0x011c|0x0326|0x0426|0x043a|0x051c|0x053a|0x071c|0x0b1c|0x0e3a|0x0f1c|0x0f3a|0x1326|0x191c|0x2326|0x3326)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x3708";
-+	match "product" "(0x20ce|0x21ce)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x4113";
-+	match "product" "(0x0210|0x0211|0x0400|0x0410)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x413c";
-+	match "product" "(0x4001|0x4002|0x4003|0x4004|0x4005|0x4006|0x4007|0x4008|0x4009)";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x413c";
-+	match "product" "(0x8102|0x8104)";
-+	action "kldload if_upgt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x413c";
-+	match "product" "(0x8114|0x8115|0x8116|0x8117|0x8118|0x8128|0x8129|0x8133|0x8134|0x8135|0x8136|0x8137|0x8138|0x8180|0x8181|0x8182)";
-+	action "kldload u3g";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x413c";
-+	match "product" "0x9500";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x4348";
-+	match "product" "0x5523";
-+	action "kldload uchcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x4505";
-+	match "product" "0x0010";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x4766";
-+	match "product" "0x0001";
-+	action "kldload uvisor";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x5173";
-+	match "product" "0x1809";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x5372";
-+	match "product" "0x2303";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x5a57";
-+	match "product" "0x0260";
-+	action "kldload if_ural";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x5a57";
-+	match "product" "(0x0280|0x0282|0x0283|0x0284|0x5257)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x5e04";
-+	match "product" "0xce00";
-+	action "kldload uipaq";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x6189";
-+	match "product" "0x182d";
-+	action "kldload if_axe";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x6189";
-+	match "product" "0x2068";
-+	action "kldload uplcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x6547";
-+	match "product" "0x0232";
-+	action "kldload uark";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x6891";
-+	match "product" "0xa727";
-+	action "kldload if_zyd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x7392";
-+	match "product" "0x7318";
-+	action "kldload if_rum";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x7392";
-+	match "product" "(0x7711|0x7717|0x7718)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x8516";
-+	match "product" "(0x2070|0x2770|0x2870|0x3070|0x3071|0x3072|0x3572)";
-+	action "kldload if_run";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9710";
-+	match "product" "0x7703";
-+	action "kldload umoscom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9710";
-+	match "product" "0x7730";
-+	action "kldload if_mos";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9710";
-+	match "product" "0x7820";
-+	action "kldload umcs";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9710";
-+	match "product" "0x7830";
-+	action "kldload if_mos";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9710";
-+	match "product" "0x7840";
-+	action "kldload umcs";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0x9e88";
-+	match "product" "0x9e8f";
-+	action "kldload uftdi";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "vendor" "0xdaae";
-+	match "product" "0xead6";
-+	action "kldload uslcom";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x02";
-+	match "intsubclass" "0x02";
-+	match "intprotocol" "0x01";
-+	action "kldload umodem";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x03";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x01";
-+	action "kldload ukbd";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x03";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x02";
-+	action "kldload ums";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x07";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x01";
-+	action "kldload ulpt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x07";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x02";
-+	action "kldload ulpt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x07";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x03";
-+	action "kldload ulpt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0xe0";
-+	match "intsubclass" "0x01";
-+	match "intprotocol" "0x01";
-+	action "kldload ng_ubt";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0xff";
-+	match "intsubclass" "0x5d";
-+	match "intprotocol" "0x01";
-+	action "kldload uhid";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x01";
-+	match "intsubclass" "0x01";
-+	action "kldload snd_uaudio";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x01";
-+	match "intsubclass" "0x03";
-+	action "kldload snd_uaudio";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "(host|device)";
-+	match "intclass" "0x02";
-+	match "intsubclass" "0x06";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "(host|device)";
-+	match "intclass" "0x02";
-+	match "intsubclass" "0x0a";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "(host|device)";
-+	match "intclass" "0x02";
-+	match "intsubclass" "0x0d";
-+	action "kldload if_cdce";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x02";
-+	match "intsubclass" "0x88";
-+	action "kldload ufoma";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x03";
-+	action "kldload uhid";
-+};
-+
-+nomatch 32 {
-+	match "bus" "uhub[0-9]+";
-+	match "mode" "host";
-+	match "intclass" "0x08";
-+	action "kldload umass";
-+};
-+
-+# 1634 USB entries processed
-+

Modified: trunk/freebsd-utils/debian/patches/001_dmesg.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/001_dmesg.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/001_dmesg.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -35,10 +35,10 @@
  			usage();
 --- a/sbin/dmesg/Makefile
 +++ b/sbin/dmesg/Makefile
-@@ -6,7 +6,7 @@
+@@ -4,7 +4,7 @@
+ PROG=	dmesg
+ MAN=	dmesg.8
  
- WARNS?=	6
- 
 -LDADD=	-lkvm
 +LDADD=	-lkvm -lbsd
  DPADD=	${LIBKVM}

Deleted: trunk/freebsd-utils/debian/patches/001_unused.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/001_unused.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/001_unused.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,2337 +0,0 @@
-
-Generated by running sed -e "s/__unused/__attribute__((unused))/g" command
-on all source files.
-
---- a/sbin/camcontrol/modeedit.c
-+++ b/sbin/camcontrol/modeedit.c
-@@ -140,7 +140,7 @@
- 
- 
- static void
--editentry_create(void *hook __unused, int letter, void *arg, int count,
-+editentry_create(void *hook __attribute__((unused)), int letter, void *arg, int count,
- 		 char *name)
- {
- 	struct editentry *newentry;	/* Buffer to hold new entry. */
-@@ -162,7 +162,7 @@
- }
- 
- static void
--editentry_update(void *hook __unused, int letter, void *arg, int count,
-+editentry_update(void *hook __attribute__((unused)), int letter, void *arg, int count,
- 		 char *name)
- {
- 	struct editentry *dest;		/* Buffer to hold entry to update. */
-@@ -190,7 +190,7 @@
- }
- 
- static int
--editentry_save(void *hook __unused, char *name)
-+editentry_save(void *hook __attribute__((unused)), char *name)
- {
- 	struct editentry *src;		/* Entry value to save. */
- 
---- a/sbin/camcontrol/util.c
-+++ b/sbin/camcontrol/util.c
-@@ -107,7 +107,7 @@
- /* arg_put: "put argument" callback
-  */
- void
--arg_put(void *hook __unused, int letter, void *arg, int count, char *name)
-+arg_put(void *hook __attribute__((unused)), int letter, void *arg, int count, char *name)
- {
- 	if (verbose && name && *name)
- 		printf("%s:  ", name);
---- a/sbin/devfs/rule.c
-+++ b/sbin/devfs/rule.c
-@@ -125,7 +125,7 @@
- }
- 
- static int
--rule_apply(int ac __unused, char **av __unused)
-+rule_apply(int ac __attribute__((unused)), char **av __attribute__((unused)))
- {
- 	struct devfs_rule dr;
- 	devfs_rnum rnum;
-@@ -153,7 +153,7 @@
- }
- 
- static int
--rule_applyset(int ac, char **av __unused)
-+rule_applyset(int ac, char **av __attribute__((unused)))
- {
- 	int rv;
- 
-@@ -166,7 +166,7 @@
- }
- 
- static int
--rule_del(int ac __unused, char **av)
-+rule_del(int ac __attribute__((unused)), char **av)
- {
- 	devfs_rid rid;
- 	int rv;
-@@ -181,7 +181,7 @@
- }
- 
- static int
--rule_delset(int ac, char **av __unused)
-+rule_delset(int ac, char **av __attribute__((unused)))
- {
- 	struct devfs_rule dr;
- 	int rv;
-@@ -202,7 +202,7 @@
- }
- 
- static int
--rule_show(int ac __unused, char **av)
-+rule_show(int ac __attribute__((unused)), char **av)
- {
- 	struct devfs_rule dr;
- 	devfs_rnum rnum;
-@@ -229,7 +229,7 @@
- }
- 
- static int
--rule_showsets(int ac, char **av __unused)
-+rule_showsets(int ac, char **av __attribute__((unused)))
- {
- 	devfs_rsnum rsnum;
- 
-@@ -307,7 +307,7 @@
-  * Construct a /struct devfs_rule/ from ac and av.
-  */
- static void
--rulespec_intok(struct devfs_rule *dr, int ac __unused, char **av,
-+rulespec_intok(struct devfs_rule *dr, int ac __attribute__((unused)), char **av,
-     devfs_rsnum rsnum)
- {
- 	struct intstr *is;
---- a/sbin/geom/class/eli/geom_eli.c
-+++ b/sbin/geom/class/eli/geom_eli.c
-@@ -1083,7 +1083,7 @@
- }
- 
- static void
--eli_delkey_attached(struct gctl_req *req, const char *prov __unused)
-+eli_delkey_attached(struct gctl_req *req, const char *prov __attribute__((unused)))
- {
- 
- 	gctl_issue(req);
---- a/sbin/geom/class/multipath/geom_multipath.c
-+++ b/sbin/geom/class/multipath/geom_multipath.c
-@@ -79,7 +79,7 @@
- };
- 
- static void
--mp_main(struct gctl_req *req, unsigned int flags __unused)
-+mp_main(struct gctl_req *req, unsigned int flags __attribute__((unused)))
- {
- 	const char *name;
- 
---- a/sbin/geom/class/part/geom_part.c
-+++ b/sbin/geom/class/part/geom_part.c
-@@ -622,7 +622,7 @@
- }
- 
- static void
--gpart_show(struct gctl_req *req, unsigned int fl __unused)
-+gpart_show(struct gctl_req *req, unsigned int fl __attribute__((unused)))
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -668,7 +668,7 @@
- }
- 
- static void
--gpart_backup(struct gctl_req *req, unsigned int fl __unused)
-+gpart_backup(struct gctl_req *req, unsigned int fl __attribute__((unused)))
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -757,13 +757,13 @@
- }
- 
- static void
--gpart_sighndl(int sig __unused)
-+gpart_sighndl(int sig __attribute__((unused)))
- {
- 	undo_restore = 1;
- }
- 
- static void
--gpart_restore(struct gctl_req *req, unsigned int fl __unused)
-+gpart_restore(struct gctl_req *req, unsigned int fl __attribute__((unused)))
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -1211,7 +1211,7 @@
- }
- 
- static void
--gpart_issue(struct gctl_req *req, unsigned int fl __unused)
-+gpart_issue(struct gctl_req *req, unsigned int fl __attribute__((unused)))
- {
- 	char buf[4096];
- 	const char *errstr;
---- a/sbin/geom/class/sched/geom_sched.c
-+++ b/sbin/geom/class/sched/geom_sched.c
-@@ -68,7 +68,7 @@
- #endif
- 
- static void
--gcmd_createinsert(struct gctl_req *req, unsigned flags __unused)
-+gcmd_createinsert(struct gctl_req *req, unsigned flags __attribute__((unused)))
- {
- 	const char *reqalgo;
- 	char name[64];
---- a/sbin/geom/core/geom.c
-+++ b/sbin/geom/core/geom.c
-@@ -770,7 +770,7 @@
- }
- 
- static void
--std_help(struct gctl_req *req __unused, unsigned flags __unused)
-+std_help(struct gctl_req *req __attribute__((unused)), unsigned flags __attribute__((unused)))
- {
- 
- 	usage();
-@@ -794,7 +794,7 @@
- }
- 
- static void
--std_list(struct gctl_req *req, unsigned flags __unused)
-+std_list(struct gctl_req *req, unsigned flags __attribute__((unused)))
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -928,7 +928,7 @@
- }
- 
- static void
--std_status(struct gctl_req *req, unsigned flags __unused)
-+std_status(struct gctl_req *req, unsigned flags __attribute__((unused)))
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -1024,7 +1024,7 @@
- }
- 
- static void
--std_load(struct gctl_req *req __unused, unsigned flags)
-+std_load(struct gctl_req *req __attribute__((unused)), unsigned flags)
- {
- 
- 	/*
-@@ -1049,7 +1049,7 @@
- }
- 
- static void
--std_unload(struct gctl_req *req, unsigned flags __unused)
-+std_unload(struct gctl_req *req, unsigned flags __attribute__((unused)))
- {
- 	char name[64];
- 	int id;
---- a/sbin/ifconfig/af_atalk.c
-+++ b/sbin/ifconfig/af_atalk.c
-@@ -55,7 +55,7 @@
- 
- /* XXX  FIXME -- should use strtoul for better parsing. */
- static void
--setatrange(const char *range, int dummy __unused, int s, 
-+setatrange(const char *range, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	u_int	first = 123, last = 123;
-@@ -69,7 +69,7 @@
- }
- 
- static void
--setatphase(const char *phase, int dummy __unused, int s, 
-+setatphase(const char *phase, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	if (!strcmp(phase, "1"))
-@@ -81,7 +81,7 @@
- }
- 
- static void
--at_status(int s __unused, const struct ifaddrs *ifa)
-+at_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
- {
- 	struct sockaddr_at *sat, null_sat;
- 	struct netrange *nr;
---- a/sbin/ifconfig/af_inet.c
-+++ b/sbin/ifconfig/af_inet.c
-@@ -57,7 +57,7 @@
- static struct ifreq in_ridreq;
- 
- static void
--in_status(int s __unused, const struct ifaddrs *ifa)
-+in_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
- {
- 	struct sockaddr_in *sin, null_sin;
- 	
---- a/sbin/ifconfig/af_inet6.c
-+++ b/sbin/ifconfig/af_inet6.c
-@@ -73,7 +73,7 @@
- static	char addr_buf[MAXHOSTNAMELEN *2 + 1];	/*for getnameinfo()*/
- 
- static void
--setifprefixlen(const char *addr, int dummy __unused, int s,
-+setifprefixlen(const char *addr, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
-         if (afp->af_getprefix != NULL)
-@@ -82,7 +82,7 @@
- }
- 
- static void
--setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused,
-+setip6flags(const char *dummyaddr __attribute__((unused)), int flag, int dummysoc __attribute__((unused)),
-     const struct afswtch *afp)
- {
- 	if (afp->af_af != AF_INET6)
-@@ -117,21 +117,21 @@
- }
- 
- static void
--setip6pltime(const char *seconds, int dummy __unused, int s, 
-+setip6pltime(const char *seconds, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	setip6lifetime("pltime", seconds, s, afp);
- }
- 
- static void
--setip6vltime(const char *seconds, int dummy __unused, int s, 
-+setip6vltime(const char *seconds, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	setip6lifetime("vltime", seconds, s, afp);
- }
- 
- static void
--setip6eui64(const char *cmd, int dummy __unused, int s,
-+setip6eui64(const char *cmd, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	struct ifaddrs *ifap, *ifa;
-@@ -177,7 +177,7 @@
- }
- 
- static void
--in6_status(int s __unused, const struct ifaddrs *ifa)
-+in6_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
- {
- 	struct sockaddr_in6 *sin, null_sin;
- 	struct in6_ifreq ifr6;
-@@ -527,7 +527,7 @@
- };
- 
- static void
--in6_Lopt_cb(const char *optarg __unused)
-+in6_Lopt_cb(const char *optarg __attribute__((unused)))
- {
- 	ip6lifetime++;	/* print IPv6 address lifetime */
- }
---- a/sbin/ifconfig/af_ipx.c
-+++ b/sbin/ifconfig/af_ipx.c
-@@ -54,7 +54,7 @@
- static struct ifreq ipx_ridreq;
- 
- static void
--ipx_status(int s __unused, const struct ifaddrs *ifa)
-+ipx_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
- {
- 	struct sockaddr_ipx *sipx, null_sipx;
- 
---- a/sbin/ifconfig/af_link.c
-+++ b/sbin/ifconfig/af_link.c
-@@ -52,7 +52,7 @@
- static struct ifreq link_ridreq;
- 
- static void
--link_status(int s __unused, const struct ifaddrs *ifa)
-+link_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
- {
- 	/* XXX no const 'cuz LLADDR is defined wrong */
- 	struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr;
---- a/sbin/ifconfig/af_nd6.c
-+++ b/sbin/ifconfig/af_nd6.c
-@@ -65,7 +65,7 @@
- void setnd6defif(const char *, int, int, const struct afswtch *);
- 
- void
--setnd6flags(const char *dummyaddr __unused,
-+setnd6flags(const char *dummyaddr __attribute__((unused)),
- 	int d, int s,
- 	const struct afswtch *afp)
- {
-@@ -89,7 +89,7 @@
- }
- 
- void
--setnd6defif(const char *dummyaddr __unused,
-+setnd6defif(const char *dummyaddr __attribute__((unused)),
- 	int d, int s,
- 	const struct afswtch *afp)
- {
---- a/sbin/ifconfig/ifclone.c
-+++ b/sbin/ifconfig/ifclone.c
-@@ -174,7 +174,7 @@
- };
- 
- static void
--clone_Copt_cb(const char *optarg __unused)
-+clone_Copt_cb(const char *optarg __attribute__((unused)))
- {
- 	list_cloners();
- 	exit(0);
---- a/sbin/ifconfig/ifconfig.c
-+++ b/sbin/ifconfig/ifconfig.c
-@@ -644,7 +644,7 @@
- }
- 
- static void
--setifvnet(const char *jname, int dummy __unused, int s,
-+setifvnet(const char *jname, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	struct ifreq my_ifr;
-@@ -658,7 +658,7 @@
- }
- 
- static void
--setifrvnet(const char *jname, int dummy __unused, int s,
-+setifrvnet(const char *jname, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	struct ifreq my_ifr;
-@@ -672,7 +672,7 @@
- }
- 
- static void
--setifnetmask(const char *addr, int dummy __unused, int s,
-+setifnetmask(const char *addr, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL) {
-@@ -682,7 +682,7 @@
- }
- 
- static void
--setifbroadaddr(const char *addr, int dummy __unused, int s,
-+setifbroadaddr(const char *addr, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL)
-@@ -690,7 +690,7 @@
- }
- 
- static void
--setifipdst(const char *addr, int dummy __unused, int s,
-+setifipdst(const char *addr, int dummy __attribute__((unused)), int s,
-     const struct afswtch *afp)
- {
- 	const struct afswtch *inet;
-@@ -723,7 +723,7 @@
- 
- /*ARGSUSED*/
- static void
--setifdstaddr(const char *addr, int param __unused, int s, 
-+setifdstaddr(const char *addr, int param __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL)
-@@ -783,7 +783,7 @@
- }
- 
- static void
--setifmetric(const char *val, int dummy __unused, int s, 
-+setifmetric(const char *val, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
-@@ -793,7 +793,7 @@
- }
- 
- static void
--setifmtu(const char *val, int dummy __unused, int s, 
-+setifmtu(const char *val, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
-@@ -803,7 +803,7 @@
- }
- 
- static void
--setifname(const char *val, int dummy __unused, int s, 
-+setifname(const char *val, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	char *newname;
-@@ -825,7 +825,7 @@
- 
- /* ARGSUSED */
- static void
--setifdescr(const char *val, int dummy __unused, int s, 
-+setifdescr(const char *val, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	char *newdescr;
---- a/sbin/ifconfig/ifgre.c
-+++ b/sbin/ifconfig/ifgre.c
-@@ -65,7 +65,7 @@
- }
- 
- static void
--setifgrekey(const char *val, int dummy __unused, int s, 
-+setifgrekey(const char *val, int dummy __attribute__((unused)), int s, 
-     const struct afswtch *afp)
- {
- 	uint32_t grekey = atol(val);
---- a/sbin/ipfw/ipfw2.c
-+++ b/sbin/ipfw/ipfw2.c
-@@ -925,7 +925,7 @@
- #define	HAVE_OPTIONS	0x8000
- 
- static void
--show_prerequisites(int *flags, int want, int cmd __unused)
-+show_prerequisites(int *flags, int want, int cmd __attribute__((unused)))
- {
- 	if (co.comment_only)
- 		return;
---- a/sbin/kldconfig/kldconfig.c
-+++ b/sbin/kldconfig/kldconfig.c
-@@ -208,7 +208,7 @@
- 
- /* Remove a path component from the module search path */
- static void
--rempath(struct pathhead *pathq, char *path, int force, int insert __unused)
-+rempath(struct pathhead *pathq, char *path, int force, int insert __attribute__((unused)))
- {
- 	char pathbuf[MAXPATHLEN+1];
- 	struct pathentry *pe;
---- a/sbin/mount_autofs/mount_autofs.c
-+++ b/sbin/mount_autofs/mount_autofs.c
-@@ -69,8 +69,8 @@
- mymount(
- 	const char *type,
- 	const char *dir,
--	int flags __unused,
--	void *data __unused
-+	int flags __attribute__((unused)),
-+	void *data __attribute__((unused))
- )
- {
- 	struct iovec iov[4], *iovp;
---- a/sbin/mount_std/mount_std.c
-+++ b/sbin/mount_std/mount_std.c
-@@ -66,7 +66,7 @@
- static void usage(void) __dead2;
- 
- static void
--catchsig(int s __unused)
-+catchsig(int s __attribute__((unused)))
- {
- 	caughtsig = 1;
- }
---- a/sys/contrib/pf/net/if_pfsync.c
-+++ b/sys/contrib/pf/net/if_pfsync.c
-@@ -488,7 +488,7 @@
- 
- void
- #ifdef __FreeBSD__
--pfsync_input(struct mbuf *m, __unused int off)
-+pfsync_input(struct mbuf *m, __attribute__((unused)) int off)
- #else
- pfsync_input(struct mbuf *m, ...)
- #endif
-@@ -2275,7 +2275,7 @@
- }
- 
- void
--pfsync_senddef(void *arg, __unused int pending)
-+pfsync_senddef(void *arg, __attribute__((unused)) int pending)
- {
- 	struct pfsync_softc *sc = (struct pfsync_softc *)arg;
- 	struct mbuf *m;
---- a/sys/contrib/pf/net/if_pfsync.h
-+++ b/sys/contrib/pf/net/if_pfsync.h
-@@ -341,7 +341,7 @@
- 
- #ifdef _KERNEL
- #ifdef __FreeBSD__
--void pfsync_input(struct mbuf *, __unused int);
-+void pfsync_input(struct mbuf *, __attribute__((unused)) int);
- #else
- void pfsync_input(struct mbuf *, ...);
- #endif
---- a/sys/contrib/pf/net/pf_if.c
-+++ b/sys/contrib/pf/net/pf_if.c
-@@ -105,12 +105,12 @@
- int		 pfi_skip_if(const char *, struct pfi_kif *);
- int		 pfi_unmask(void *);
- #ifdef __FreeBSD__
--void		 pfi_attach_ifnet_event(void * __unused, struct ifnet *);
--void		 pfi_detach_ifnet_event(void * __unused, struct ifnet *);
--void		 pfi_attach_group_event(void * __unused, struct ifg_group *);
--void		 pfi_change_group_event(void * __unused, char *);
--void		 pfi_detach_group_event(void * __unused, struct ifg_group *);
--void		 pfi_ifaddr_event(void * __unused, struct ifnet *);
-+void		 pfi_attach_ifnet_event(void * __attribute__((unused)), struct ifnet *);
-+void		 pfi_detach_ifnet_event(void * __attribute__((unused)), struct ifnet *);
-+void		 pfi_attach_group_event(void * __attribute__((unused)), struct ifg_group *);
-+void		 pfi_change_group_event(void * __attribute__((unused)), char *);
-+void		 pfi_detach_group_event(void * __attribute__((unused)), struct ifg_group *);
-+void		 pfi_ifaddr_event(void * __attribute__((unused)), struct ifnet *);
- 
- #endif
- 
-@@ -892,7 +892,7 @@
- 
- #ifdef __FreeBSD__
- void
--pfi_attach_ifnet_event(void *arg __unused, struct ifnet *ifp)
-+pfi_attach_ifnet_event(void *arg __attribute__((unused)), struct ifnet *ifp)
- {
- 	PF_LOCK();
- 	pfi_attach_ifnet(ifp);
-@@ -903,7 +903,7 @@
- }
- 
- void
--pfi_detach_ifnet_event(void *arg __unused, struct ifnet *ifp)
-+pfi_detach_ifnet_event(void *arg __attribute__((unused)), struct ifnet *ifp)
- {
- 	PF_LOCK();
- 	pfi_detach_ifnet(ifp);
-@@ -914,7 +914,7 @@
- }
- 
- void
--pfi_attach_group_event(void *arg __unused, struct ifg_group *ifg)
-+pfi_attach_group_event(void *arg __attribute__((unused)), struct ifg_group *ifg)
- {
- 	PF_LOCK();
- 	pfi_attach_ifgroup(ifg);
-@@ -922,7 +922,7 @@
- }
- 
- void
--pfi_change_group_event(void *arg __unused, char *gname)
-+pfi_change_group_event(void *arg __attribute__((unused)), char *gname)
- {
- 	PF_LOCK();
- 	pfi_group_change(gname);
-@@ -930,7 +930,7 @@
- }
- 
- void
--pfi_detach_group_event(void *arg __unused, struct ifg_group *ifg)
-+pfi_detach_group_event(void *arg __attribute__((unused)), struct ifg_group *ifg)
- {
- 	PF_LOCK();
- 	pfi_detach_ifgroup(ifg);
-@@ -938,7 +938,7 @@
- }
- 
- void
--pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp)
-+pfi_ifaddr_event(void *arg __attribute__((unused)), struct ifnet *ifp)
- {
- 	PF_LOCK();
- 	if (ifp && ifp->if_pf_kif)
---- a/sys/geom/eli/g_eli.c
-+++ b/sys/geom/eli/g_eli.c
-@@ -969,8 +969,8 @@
- }
- 
- static int
--g_eli_destroy_geom(struct gctl_req *req __unused,
--    struct g_class *mp __unused, struct g_geom *gp)
-+g_eli_destroy_geom(struct gctl_req *req __attribute__((unused)),
-+    struct g_class *mp __attribute__((unused)), struct g_geom *gp)
- {
- 	struct g_eli_softc *sc;
- 
-@@ -1041,7 +1041,7 @@
-  * We detect providers which should be attached before root is mounted.
-  */
- static struct g_geom *
--g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
-+g_eli_taste(struct g_class *mp, struct g_provider *pp, int flags __attribute__((unused)))
- {
- 	struct g_eli_metadata md;
- 	struct g_geom *gp;
---- a/usr.bin/ktrace/ktrace.c
-+++ b/usr.bin/ktrace/ktrace.c
-@@ -200,7 +200,7 @@
- }
- 
- static void
--no_ktrace(int sig __unused)
-+no_ktrace(int sig __attribute__((unused)))
- {
-         (void)fprintf(stderr,
- "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n");
---- a/usr.bin/netstat/atalk.c
-+++ b/usr.bin/netstat/atalk.c
-@@ -217,8 +217,8 @@
- }
- 
- void
--atalkprotopr(u_long off __unused, const char *name, int af1 __unused,
--    int proto __unused)
-+atalkprotopr(u_long off __attribute__((unused)), const char *name, int af1 __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct ddpcb *this, *next;
- 
-@@ -267,8 +267,8 @@
-  * Dump DDP statistics structure.
-  */
- void
--ddp_stats(u_long off __unused, const char *name, int af1 __unused,
--    int proto __unused)
-+ddp_stats(u_long off __attribute__((unused)), const char *name, int af1 __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct ddpstat ddpstat;
- 
---- a/usr.bin/netstat/if.c
-+++ b/usr.bin/netstat/if.c
-@@ -86,7 +86,7 @@
-  * Dump pfsync statistics structure.
-  */
- void
--pfsync_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+pfsync_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct pfsyncstats pfsyncstat, zerostat;
- 	size_t len = sizeof(struct pfsyncstats);
-@@ -707,7 +707,7 @@
-  * caught.
-  */
- static void
--catchalarm(int signo __unused)
-+catchalarm(int signo __attribute__((unused)))
- {
- 	signalled = YES;
- }
---- a/usr.bin/netstat/inet.c
-+++ b/usr.bin/netstat/inet.c
-@@ -559,7 +559,7 @@
-  * Dump TCP statistics structure.
-  */
- void
--tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+tcp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct tcpstat tcpstat, zerostat;
- 	size_t len = sizeof tcpstat;
-@@ -701,7 +701,7 @@
-  * Dump UDP statistics structure.
-  */
- void
--udp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+udp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct udpstat udpstat, zerostat;
- 	size_t len = sizeof udpstat;
-@@ -761,7 +761,7 @@
-  * Dump CARP statistics structure.
-  */
- void
--carp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+carp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct carpstats carpstat, zerostat;
- 	size_t len = sizeof(struct carpstats);
-@@ -812,7 +812,7 @@
-  * Dump IP statistics structure.
-  */
- void
--ip_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+ip_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ipstat ipstat, zerostat;
- 	size_t len = sizeof ipstat;
-@@ -876,7 +876,7 @@
-  * Dump ARP statistics structure.
-  */
- void
--arp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+arp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct arpstat arpstat, zerostat;
- 	size_t len = sizeof(arpstat);
-@@ -961,7 +961,7 @@
-  * Dump ICMP statistics.
-  */
- void
--icmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+icmp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct icmpstat icmpstat, zerostat;
- 	int i, first;
-@@ -1084,7 +1084,7 @@
-  * Dump IGMP statistics structure.
-  */
- void
--igmp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+igmp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct igmpstat igmpstat, zerostat;
- 	size_t len;
-@@ -1166,8 +1166,8 @@
-  * Dump PIM statistics structure.
-  */
- void
--pim_stats(u_long off __unused, const char *name, int af1 __unused,
--    int proto __unused)
-+pim_stats(u_long off __attribute__((unused)), const char *name, int af1 __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct pimstat pimstat, zerostat;
- 	size_t len = sizeof pimstat;
---- a/usr.bin/netstat/inet6.c
-+++ b/usr.bin/netstat/inet6.c
-@@ -362,7 +362,7 @@
-  * Dump IP6 statistics structure.
-  */
- void
--ip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+ip6_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ip6stat ip6stat;
- 	int first, i;
-@@ -842,7 +842,7 @@
-  * Dump ICMP6 statistics.
-  */
- void
--icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+icmp6_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct icmp6stat icmp6stat;
- 	int i, first;
-@@ -997,7 +997,7 @@
-  * Dump PIM statistics structure.
-  */
- void
--pim6_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+pim6_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct pim6stat pim6stat, zerostat;
- 	size_t len = sizeof pim6stat;
-@@ -1035,7 +1035,7 @@
-  * Dump raw ip6 statistics structure.
-  */
- void
--rip6_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+rip6_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct rip6stat rip6stat;
- 	u_quad_t delivered;
---- a/usr.bin/netstat/ipsec.c
-+++ b/usr.bin/netstat/ipsec.c
-@@ -265,7 +265,7 @@
- }
- 
- void
--ipsec_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+ipsec_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ipsecstat ipsecstat;
- 
-@@ -353,7 +353,7 @@
- }
- 
- void
--ah_stats(u_long off, const char *name, int family __unused, int proto __unused)
-+ah_stats(u_long off, const char *name, int family __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ahstat ahstat;
- 
-@@ -403,7 +403,7 @@
- }
- 
- void
--esp_stats(u_long off, const char *name, int family __unused, int proto __unused)
-+esp_stats(u_long off, const char *name, int family __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct espstat espstat;
- 
-@@ -458,8 +458,8 @@
- }
- 
- void
--ipcomp_stats(u_long off, const char *name, int family __unused,
--    int proto __unused)
-+ipcomp_stats(u_long off, const char *name, int family __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct ipcompstat ipcompstat;
- 
---- a/usr.bin/netstat/ipx.c
-+++ b/usr.bin/netstat/ipx.c
-@@ -81,7 +81,7 @@
-  */
- 
- void
--ipxprotopr(u_long off, const char *name, int af1 __unused, int proto __unused)
-+ipxprotopr(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ipxpcbhead cb;
- 	struct ipxpcb *ipxp;
-@@ -154,7 +154,7 @@
-  * Dump SPX statistics structure.
-  */
- void
--spx_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+spx_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct spx_istat spx_istat;
- #define	spxstat spx_istat.newstats
-@@ -230,7 +230,7 @@
-  * Dump IPX statistics structure.
-  */
- void
--ipx_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+ipx_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ipxstat ipxstat;
- 
-@@ -273,7 +273,7 @@
-  */
- /*ARGSUSED*/
- void
--ipxerr_stats(u_long off, const char *name, int af __unused, int proto __unused)
-+ipxerr_stats(u_long off, const char *name, int af __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct ipx_errstat ipx_errstat;
- 	int j;
---- a/usr.bin/netstat/netgraph.c
-+++ b/usr.bin/netstat/netgraph.c
-@@ -62,8 +62,8 @@
- static	int csock = -1;
- 
- void
--netgraphprotopr(u_long off, const char *name, int af1 __unused,
--    int proto __unused)
-+netgraphprotopr(u_long off, const char *name, int af1 __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct ngpcb *this, *next;
- 	struct ngpcb ngpcb;
---- a/usr.bin/netstat/pfkey.c
-+++ b/usr.bin/netstat/pfkey.c
-@@ -114,8 +114,8 @@
- }
- 
- void
--pfkey_stats(u_long off, const char *name, int family __unused,
--    int proto __unused)
-+pfkey_stats(u_long off, const char *name, int family __attribute__((unused)),
-+    int proto __attribute__((unused)))
- {
- 	struct pfkeystat pfkeystat;
- 	unsigned first, type;
---- a/usr.bin/netstat/route.c
-+++ b/usr.bin/netstat/route.c
-@@ -283,7 +283,7 @@
- static int wid_expire;
- 
- static void
--size_cols(int ef __unused, struct radix_node *rn)
-+size_cols(int ef __attribute__((unused)), struct radix_node *rn)
- {
- 	wid_dst = WID_DST_DEFAULT(ef);
- 	wid_gw = WID_GW_DEFAULT(ef);
-@@ -840,7 +840,7 @@
- 	0)
- 
- static void
--domask(char *dst, in_addr_t addr __unused, u_long mask)
-+domask(char *dst, in_addr_t addr __attribute__((unused)), u_long mask)
- {
- 	int b, i;
- 
---- a/usr.bin/netstat/sctp.c
-+++ b/usr.bin/netstat/sctp.c
-@@ -431,7 +431,7 @@
-  * protocol.
-  */
- void
--sctp_protopr(u_long off __unused,
-+sctp_protopr(u_long off __attribute__((unused)),
-     const char *name, int af1, int proto)
- {
- 	char *buf;
-@@ -510,7 +510,7 @@
-  * Dump SCTP statistics structure.
-  */
- void
--sctp_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
-+sctp_stats(u_long off, const char *name, int af1 __attribute__((unused)), int proto __attribute__((unused)))
- {
- 	struct sctpstat sctpstat, zerostat;
- 	size_t len = sizeof(sctpstat);
---- a/usr.bin/vmstat/vmstat.c
-+++ b/usr.bin/vmstat/vmstat.c
-@@ -861,7 +861,7 @@
-  * Force a header to be prepended to the next output.
-  */
- static void
--needhdr(int dummy __unused)
-+needhdr(int dummy __attribute__((unused)))
- {
- 
- 	hdrcnt = 1;
---- a/usr.sbin/arp/arp.c
-+++ b/usr.sbin/arp/arp.c
-@@ -656,8 +656,8 @@
-  * Nuke an arp entry
-  */
- static void
--nuke_entry(struct sockaddr_dl *sdl __unused,
--	struct sockaddr_inarp *addr, struct rt_msghdr *rtm __unused)
-+nuke_entry(struct sockaddr_dl *sdl __attribute__((unused)),
-+	struct sockaddr_inarp *addr, struct rt_msghdr *rtm __attribute__((unused)))
- {
- 	char ip[20];
- 
---- a/usr.sbin/nfscbd/nfscbd.c
-+++ b/usr.sbin/nfscbd/nfscbd.c
-@@ -323,13 +323,13 @@
- }
- 
- static void
--nonfs(int signo __unused)
-+nonfs(int signo __attribute__((unused)))
- {
- 	syslog(LOG_ERR, "missing system call: NFS not available");
- }
- 
- static void
--reapchild(int signo __unused)
-+reapchild(int signo __attribute__((unused)))
- {
- 	pid_t pid;
- 
-@@ -351,7 +351,7 @@
-  * Cleanup master after SIGUSR1.
-  */
- static void
--cleanup(int signo __unused)
-+cleanup(int signo __attribute__((unused)))
- {
- 	nfscbd_exit(0);
- }
-@@ -360,13 +360,13 @@
-  * Cleanup child after SIGUSR1.
-  */
- static void
--child_cleanup(int signo __unused)
-+child_cleanup(int signo __attribute__((unused)))
- {
- 	exit(0);
- }
- 
- static void
--nfscbd_exit(int status __unused)
-+nfscbd_exit(int status __attribute__((unused)))
- {
- 	killchildren();
- 	exit(status);
---- a/usr.sbin/nfsd/nfsd.c
-+++ b/usr.sbin/nfsd/nfsd.c
-@@ -849,13 +849,13 @@
- }
- 
- void
--nonfs(__unused int signo)
-+nonfs(__attribute__((unused)) int signo)
- {
- 	syslog(LOG_ERR, "missing system call: NFS not available");
- }
- 
- void
--reapchild(__unused int signo)
-+reapchild(__attribute__((unused)) int signo)
- {
- 	pid_t pid;
- 	int i;
-@@ -890,7 +890,7 @@
-  * Cleanup master after SIGUSR1.
-  */
- void
--cleanup(__unused int signo)
-+cleanup(__attribute__((unused)) int signo)
- {
- 	nfsd_exit(0);
- }
-@@ -899,7 +899,7 @@
-  * Cleanup child after SIGUSR1.
-  */
- void
--child_cleanup(__unused int signo)
-+child_cleanup(__attribute__((unused)) int signo)
- {
- 	exit(0);
- }
---- a/usr.sbin/nfsuserd/nfsuserd.c
-+++ b/usr.sbin/nfsuserd/nfsuserd.c
-@@ -618,7 +618,7 @@
-  * cleanup_term() called via SIGUSR1.
-  */
- static void
--cleanup_term(int signo __unused)
-+cleanup_term(int signo __attribute__((unused)))
- {
- 	int i, cnt;
- 
---- a/usr.sbin/ppp/acf.c
-+++ b/usr.sbin/ppp/acf.c
-@@ -56,8 +56,8 @@
- }
- 
- static struct mbuf *
--acf_LayerPush(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--              int pri __unused, u_short *proto)
-+acf_LayerPush(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+              int pri __attribute__((unused)), u_short *proto)
- {
-   const u_char cp[2] = { HDLC_ADDR, HDLC_UI };
- 
-@@ -70,8 +70,8 @@
- }
- 
- static struct mbuf *
--acf_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--	      u_short *proto __unused)
-+acf_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+	      u_short *proto __attribute__((unused)))
- {
-   struct physical *p = link2physical(l);
-   u_char cp[2];
---- a/usr.sbin/ppp/async.c
-+++ b/usr.sbin/ppp/async.c
-@@ -100,8 +100,8 @@
- }
- 
- static struct mbuf *
--async_LayerPush(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--                int pri __unused, u_short *proto)
-+async_LayerPush(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+                int pri __attribute__((unused)), u_short *proto)
- {
-   struct physical *p = link2physical(l);
-   u_char *cp, *sp, *ep;
-@@ -187,8 +187,8 @@
- }
- 
- static struct mbuf *
--async_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--                u_short *proto __unused)
-+async_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+                u_short *proto __attribute__((unused)))
- {
-   struct mbuf *nbp, **last;
-   struct physical *p = link2physical(l);
---- a/usr.sbin/ppp/atm.c
-+++ b/usr.sbin/ppp/atm.c
-@@ -106,7 +106,7 @@
- 
- static void
- atm_device2iov(struct device *d, struct iovec *iov, int *niov,
--               int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-+               int maxiov __attribute__((unused)), int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused)))
- {
-   int sz = physical_MaxDeviceSize();
- 
-@@ -142,7 +142,7 @@
- 
- struct device *
- atm_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
--               int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-+               int maxiov __attribute__((unused)), int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused)))
- {
-   if (type == ATM_DEVICE) {
-     struct atmdevice *dev = (struct atmdevice *)iov[(*niov)++].iov_base;
---- a/usr.sbin/ppp/bundle.c
-+++ b/usr.sbin/ppp/bundle.c
-@@ -164,7 +164,7 @@
- }
- 
- static void
--bundle_LayerStart(void *v __unused, struct fsm *fp __unused)
-+bundle_LayerStart(void *v __attribute__((unused)), struct fsm *fp __attribute__((unused)))
- {
-   /* The given FSM is about to start up ! */
- }
-@@ -529,7 +529,7 @@
- }
- 
- static void
--bundle_DescriptorRead(struct fdescriptor *d __unused, struct bundle *bundle,
-+bundle_DescriptorRead(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle,
-                       const fd_set *fdset)
- {
-   struct datalink *dl;
-@@ -641,7 +641,7 @@
- }
- 
- static int
--bundle_DescriptorWrite(struct fdescriptor *d __unused, struct bundle *bundle,
-+bundle_DescriptorWrite(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle,
-                        const fd_set *fdset)
- {
-   struct datalink *dl;
---- a/usr.sbin/ppp/cbcp.c
-+++ b/usr.sbin/ppp/cbcp.c
-@@ -619,7 +619,7 @@
- }
- 
- extern struct mbuf *
--cbcp_Input(struct bundle *bundle __unused, struct link *l, struct mbuf *bp)
-+cbcp_Input(struct bundle *bundle __attribute__((unused)), struct link *l, struct mbuf *bp)
- {
-   struct physical *p = link2physical(l);
-   struct cbcp_header *head;
---- a/usr.sbin/ppp/ccp.c
-+++ b/usr.sbin/ppp/ccp.c
-@@ -407,7 +407,7 @@
- }
- 
- static void
--CcpSentTerminateReq(struct fsm *fp __unused)
-+CcpSentTerminateReq(struct fsm *fp __attribute__((unused)))
- {
-   /* Term REQ just sent by FSM */
- }
-@@ -715,7 +715,7 @@
- }
- 
- static struct mbuf *
--ccp_LayerPush(struct bundle *b __unused, struct link *l, struct mbuf *bp,
-+ccp_LayerPush(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-               int pri, u_short *proto)
- {
-   if (PROTO_COMPRESSIBLE(*proto)) {
-@@ -745,7 +745,7 @@
- }
- 
- static struct mbuf *
--ccp_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
-+ccp_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
- 	      u_short *proto)
- {
-   /*
-@@ -812,13 +812,13 @@
- }
- 
- int
--ccp_DefaultUsable(struct fsm *fp __unused)
-+ccp_DefaultUsable(struct fsm *fp __attribute__((unused)))
- {
-   return 1;
- }
- 
- int
--ccp_DefaultRequired(struct fsm *fp __unused)
-+ccp_DefaultRequired(struct fsm *fp __attribute__((unused)))
- {
-   return 0;
- }
---- a/usr.sbin/ppp/chap.c
-+++ b/usr.sbin/ppp/chap.c
-@@ -393,8 +393,8 @@
- }
- 
- static int
--chap_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __unused,
--	       fd_set *e __unused, int *n)
-+chap_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __attribute__((unused)),
-+	       fd_set *e __attribute__((unused)), int *n)
- {
-   struct chap *chap = descriptor2chap(d);
- 
-@@ -418,8 +418,8 @@
- }
- 
- static void
--chap_Read(struct fdescriptor *d, struct bundle *bundle __unused,
--	  const fd_set *fdset __unused)
-+chap_Read(struct fdescriptor *d, struct bundle *bundle __attribute__((unused)),
-+	  const fd_set *fdset __attribute__((unused)))
- {
-   struct chap *chap = descriptor2chap(d);
-   int got;
-@@ -475,8 +475,8 @@
- }
- 
- static int
--chap_Write(struct fdescriptor *d __unused, struct bundle *bundle __unused,
--	   const fd_set *fdset __unused)
-+chap_Write(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle __attribute__((unused)),
-+	   const fd_set *fdset __attribute__((unused)))
- {
-   /* We never want to write here ! */
-   log_Printf(LogALERT, "chap_Write: Internal error: Bad call !\n");
---- a/usr.sbin/ppp/chat.c
-+++ b/usr.sbin/ppp/chat.c
-@@ -371,8 +371,8 @@
- }
- 
- static void
--chat_Read(struct fdescriptor *d, struct bundle *bundle __unused,
--	  const fd_set *fdset __unused)
-+chat_Read(struct fdescriptor *d, struct bundle *bundle __attribute__((unused)),
-+	  const fd_set *fdset __attribute__((unused)))
- {
-   struct chat *c = descriptor2chat(d);
- 
-@@ -486,8 +486,8 @@
- }
- 
- static int
--chat_Write(struct fdescriptor *d, struct bundle *bundle __unused,
--	   const fd_set *fdset __unused)
-+chat_Write(struct fdescriptor *d, struct bundle *bundle __attribute__((unused)),
-+	   const fd_set *fdset __attribute__((unused)))
- {
-   struct chat *c = descriptor2chat(d);
-   int result = 0;
---- a/usr.sbin/ppp/command.c
-+++ b/usr.sbin/ppp/command.c
-@@ -383,7 +383,7 @@
- }
- 
- static int
--SaveCommand(struct cmdargs const *arg __unused)
-+SaveCommand(struct cmdargs const *arg __attribute__((unused)))
- {
-   log_Printf(LogWARN, "save command is not yet implemented.\n");
-   return 1;
---- a/usr.sbin/ppp/deflate.c
-+++ b/usr.sbin/ppp/deflate.c
-@@ -66,8 +66,8 @@
- }
- 
- static struct mbuf *
--DeflateOutput(void *v, struct ccp *ccp, struct link *l __unused,
--	      int pri __unused, u_short *proto, struct mbuf *mp)
-+DeflateOutput(void *v, struct ccp *ccp, struct link *l __attribute__((unused)),
-+	      int pri __attribute__((unused)), u_short *proto, struct mbuf *mp)
- {
-   struct deflate_state *state = (struct deflate_state *)v;
-   u_char *wp, *rp;
-@@ -440,7 +440,7 @@
- }
- 
- static void
--DeflateInitOptsOutput(struct bundle *bundle __unused, struct fsm_opt *o,
-+DeflateInitOptsOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o,
-                       const struct ccp_config *cfg)
- {
-   o->hdr.len = 4;
-@@ -449,8 +449,8 @@
- }
- 
- static int
--DeflateSetOptsOutput(struct bundle *bundle __unused, struct fsm_opt *o,
--                     const struct ccp_config *cfg __unused)
-+DeflateSetOptsOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o,
-+                     const struct ccp_config *cfg __attribute__((unused)))
- {
-   if (o->hdr.len != 4 || (o->data[0] & 15) != 8 || o->data[1] != '\0')
-     return MODE_REJ;
-@@ -464,7 +464,7 @@
- }
- 
- static int
--DeflateSetOptsInput(struct bundle *bundle __unused, struct fsm_opt *o,
-+DeflateSetOptsInput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o,
-                     const struct ccp_config *cfg)
- {
-   int want;
-@@ -486,7 +486,7 @@
- }
- 
- static void *
--DeflateInitInput(struct bundle *bundle __unused, struct fsm_opt *o)
-+DeflateInitInput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o)
- {
-   struct deflate_state *state;
- 
-@@ -509,7 +509,7 @@
- }
- 
- static void *
--DeflateInitOutput(struct bundle *bundle __unused, struct fsm_opt *o)
-+DeflateInitOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o)
- {
-   struct deflate_state *state;
- 
---- a/usr.sbin/ppp/defs.c
-+++ b/usr.sbin/ppp/defs.c
-@@ -443,7 +443,7 @@
- }
- #else
- int
--loadmodules(int how __unused, const char *module __unused, ...)
-+loadmodules(int how __attribute__((unused)), const char *module __attribute__((unused)), ...)
- {
-   return 0;
- }
---- a/usr.sbin/ppp/ether.c
-+++ b/usr.sbin/ppp/ether.c
-@@ -191,7 +191,7 @@
- 
- static void
- ether_device2iov(struct device *d, struct iovec *iov, int *niov,
--                 int maxiov __unused, int *auxfd, int *nauxfd)
-+                 int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   struct etherdevice *dev;
-   int sz = physical_MaxDeviceSize();
-@@ -344,7 +344,7 @@
- 
- struct device *
- ether_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
--                 int maxiov __unused, int *auxfd, int *nauxfd)
-+                 int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   if (type == ETHER_DEVICE) {
-     struct etherdevice *dev = (struct etherdevice *)iov[(*niov)++].iov_base;
---- a/usr.sbin/ppp/exec.c
-+++ b/usr.sbin/ppp/exec.c
-@@ -94,7 +94,7 @@
- 
- static void
- exec_device2iov(struct device *d, struct iovec *iov, int *niov,
--               int maxiov __unused, int *auxfd, int *nauxfd)
-+               int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   struct execdevice *dev;
-   int sz = physical_MaxDeviceSize();
-@@ -172,7 +172,7 @@
- 
- struct device *
- exec_iov2device(int type, struct physical *p, struct iovec *iov,
--                int *niov, int maxiov __unused, int *auxfd, int *nauxfd)
-+                int *niov, int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   if (type == EXEC_DEVICE) {
-     struct execdevice *dev = (struct execdevice *)iov[(*niov)++].iov_base;
---- a/usr.sbin/ppp/fsm.c
-+++ b/usr.sbin/ppp/fsm.c
-@@ -771,7 +771,7 @@
- }
- 
- static void
--FsmRecvTermAck(struct fsm *fp, struct fsmheader *lhp __unused, struct mbuf *bp)
-+FsmRecvTermAck(struct fsm *fp, struct fsmheader *lhp __attribute__((unused)), struct mbuf *bp)
- /* RTA */
- {
-   switch (fp->state) {
-@@ -867,14 +867,14 @@
- }
- 
- static void
--FsmRecvCodeRej(struct fsm *fp __unused, struct fsmheader *lhp __unused,
-+FsmRecvCodeRej(struct fsm *fp __attribute__((unused)), struct fsmheader *lhp __attribute__((unused)),
- 	       struct mbuf *bp)
- {
-   m_freem(bp);
- }
- 
- static void
--FsmRecvProtoRej(struct fsm *fp, struct fsmheader *lhp __unused, struct mbuf *bp)
-+FsmRecvProtoRej(struct fsm *fp, struct fsmheader *lhp __attribute__((unused)), struct mbuf *bp)
- {
-   struct physical *p = link2physical(fp->link);
-   u_short proto;
-@@ -974,7 +974,7 @@
- }
- 
- static void
--FsmRecvEchoRep(struct fsm *fp, struct fsmheader *lhp __unused, struct mbuf *bp)
-+FsmRecvEchoRep(struct fsm *fp, struct fsmheader *lhp __attribute__((unused)), struct mbuf *bp)
- {
-   if (fsm2lcp(fp))
-     bp = lqr_RecvEcho(fp, bp);
-@@ -983,7 +983,7 @@
- }
- 
- static void
--FsmRecvDiscReq(struct fsm *fp __unused, struct fsmheader *lhp __unused,
-+FsmRecvDiscReq(struct fsm *fp __attribute__((unused)), struct fsmheader *lhp __attribute__((unused)),
- 	       struct mbuf *bp)
- {
-   m_freem(bp);
-@@ -1012,7 +1012,7 @@
- }
- 
- static void
--FsmRecvTimeRemain(struct fsm *fp __unused, struct fsmheader *lhp __unused,
-+FsmRecvTimeRemain(struct fsm *fp __attribute__((unused)), struct fsmheader *lhp __attribute__((unused)),
- 		  struct mbuf *bp)
- {
-   m_freem(bp);
-@@ -1103,7 +1103,7 @@
- }
- 
- void
--fsm_NullRecvResetAck(struct fsm *fp, u_char id __unused)
-+fsm_NullRecvResetAck(struct fsm *fp, u_char id __attribute__((unused)))
- {
-   log_Printf(fp->LogLevel, "%s: Oops - received unexpected reset ack\n",
-             fp->link->name);
---- a/usr.sbin/ppp/hdlc.c
-+++ b/usr.sbin/ppp/hdlc.c
-@@ -138,8 +138,8 @@
- }
- 
- static struct mbuf *
--hdlc_LayerPush(struct bundle *bundle __unused, struct link *l __unused,
--	       struct mbuf *bp, int pri __unused, u_short *proto __unused)
-+hdlc_LayerPush(struct bundle *bundle __attribute__((unused)), struct link *l __attribute__((unused)),
-+	       struct mbuf *bp, int pri __attribute__((unused)), u_short *proto __attribute__((unused)))
- {
-   struct mbuf *last;
-   u_char *cp;
-@@ -298,8 +298,8 @@
- }
- 
- static struct mbuf *
--hdlc_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--               u_short *proto __unused)
-+hdlc_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+               u_short *proto __attribute__((unused)))
- {
-   struct physical *p = link2physical(l);
-   u_short fcs;
---- a/usr.sbin/ppp/ip.c
-+++ b/usr.sbin/ppp/ip.c
-@@ -208,7 +208,7 @@
- int
- FilterCheck(const unsigned char *packet,
- #ifdef NOINET6
--	    u_int32_t family __unused,
-+	    u_int32_t family __attribute__((unused)),
- #else
- 	    u_int32_t family,
- #endif
---- a/usr.sbin/ppp/ipcp.c
-+++ b/usr.sbin/ppp/ipcp.c
-@@ -800,7 +800,7 @@
- }
- 
- static void
--IpcpSentTerminateReq(struct fsm *fp __unused)
-+IpcpSentTerminateReq(struct fsm *fp __attribute__((unused)))
- {
-   /* Term REQ just sent by FSM */
- }
---- a/usr.sbin/ppp/ipv6cp.c
-+++ b/usr.sbin/ppp/ipv6cp.c
-@@ -376,14 +376,14 @@
- }
- 
- void
--ipv6cp_IfaceAddrAdded(struct ipv6cp *ipv6cp __unused,
--		      const struct iface_addr *addr __unused)
-+ipv6cp_IfaceAddrAdded(struct ipv6cp *ipv6cp __attribute__((unused)),
-+		      const struct iface_addr *addr __attribute__((unused)))
- {
- }
- 
- void
--ipv6cp_IfaceAddrDeleted(struct ipv6cp *ipv6cp __unused,
--			const struct iface_addr *addr __unused)
-+ipv6cp_IfaceAddrDeleted(struct ipv6cp *ipv6cp __attribute__((unused)),
-+			const struct iface_addr *addr __attribute__((unused)))
- {
- }
- 
-@@ -633,7 +633,7 @@
- }
- 
- static void
--ipv6cp_SentTerminateReq(struct fsm *fp __unused)
-+ipv6cp_SentTerminateReq(struct fsm *fp __attribute__((unused)))
- {
-   /* Term REQ just sent by FSM */
- }
---- a/usr.sbin/ppp/lcp.c
-+++ b/usr.sbin/ppp/lcp.c
-@@ -532,7 +532,7 @@
- }
- 
- static void
--LcpSentTerminateReq(struct fsm *fp __unused)
-+LcpSentTerminateReq(struct fsm *fp __attribute__((unused)))
- {
-   /* Term REQ just sent by FSM */
- }
-@@ -1296,7 +1296,7 @@
- }
- 
- extern struct mbuf *
--lcp_Input(struct bundle *bundle __unused, struct link *l, struct mbuf *bp)
-+lcp_Input(struct bundle *bundle __attribute__((unused)), struct link *l, struct mbuf *bp)
- {
-   /* Got PROTO_LCP from link */
-   m_settype(bp, MB_LCPIN);
---- a/usr.sbin/ppp/lqr.c
-+++ b/usr.sbin/ppp/lqr.c
-@@ -198,7 +198,7 @@
- }
- 
- struct mbuf *
--lqr_Input(struct bundle *bundle __unused, struct link *l, struct mbuf *bp)
-+lqr_Input(struct bundle *bundle __attribute__((unused)), struct link *l, struct mbuf *bp)
- {
-   struct physical *p = link2physical(l);
-   struct lcp *lcp = p->hdlc.lqm.owner;
-@@ -413,8 +413,8 @@
- }
- 
- static struct mbuf *
--lqr_LayerPush(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--              int pri __unused, u_short *proto)
-+lqr_LayerPush(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+              int pri __attribute__((unused)), u_short *proto)
- {
-   struct physical *p = link2physical(l);
-   int len, layer, extra_async_bytes;
-@@ -510,7 +510,7 @@
- }
- 
- static struct mbuf *
--lqr_LayerPull(struct bundle *b __unused, struct link *l __unused,
-+lqr_LayerPull(struct bundle *b __attribute__((unused)), struct link *l __attribute__((unused)),
- 	      struct mbuf *bp, u_short *proto)
- {
-   /*
---- a/usr.sbin/ppp/main.c
-+++ b/usr.sbin/ppp/main.c
-@@ -158,14 +158,14 @@
- }
- 
- static void
--TerminalCont(int signo __unused)
-+TerminalCont(int signo __attribute__((unused)))
- {
-   signal(SIGCONT, SIG_DFL);
-   prompt_Continue(SignalPrompt);
- }
- 
- static void
--TerminalStop(int signo __unused)
-+TerminalStop(int signo __attribute__((unused)))
- {
-   prompt_Suspend(SignalPrompt);
-   signal(SIGCONT, TerminalCont);
-@@ -173,7 +173,7 @@
- }
- 
- static void
--BringDownServer(int signo __unused)
-+BringDownServer(int signo __attribute__((unused)))
- {
-   /* Drops all child prompts too ! */
-   if (server_Close(SignalBundle))
-@@ -181,7 +181,7 @@
- }
- 
- static void
--RestartServer(int signo __unused)
-+RestartServer(int signo __attribute__((unused)))
- {
-   /* Drops all child prompts and re-opens the socket */
-   server_Reopen(SignalBundle);
---- a/usr.sbin/ppp/mp.c
-+++ b/usr.sbin/ppp/mp.c
-@@ -161,13 +161,13 @@
- }
- 
- static void
--mp_LayerStart(void *v __unused, struct fsm *fp __unused)
-+mp_LayerStart(void *v __attribute__((unused)), struct fsm *fp __attribute__((unused)))
- {
-   /* The given FSM (ccp) is about to start up ! */
- }
- 
- static void
--mp_LayerUp(void *v __unused, struct fsm *fp)
-+mp_LayerUp(void *v __attribute__((unused)), struct fsm *fp)
- {
-   /* The given fsm (ccp) is now up */
- 
-@@ -175,13 +175,13 @@
- }
- 
- static void
--mp_LayerDown(void *v __unused, struct fsm *fp __unused)
-+mp_LayerDown(void *v __attribute__((unused)), struct fsm *fp __attribute__((unused)))
- {
-   /* The given FSM (ccp) has been told to come down */
- }
- 
- static void
--mp_LayerFinish(void *v __unused, struct fsm *fp)
-+mp_LayerFinish(void *v __attribute__((unused)), struct fsm *fp)
- {
-   /* The given fsm (ccp) is now down */
-   if (fp->state == ST_CLOSED && fp->open_mode == OPEN_PASSIVE)
-@@ -1076,7 +1076,7 @@
- 
- static void
- mpserver_Read(struct fdescriptor *d, struct bundle *bundle,
--	      const fd_set *fdset __unused)
-+	      const fd_set *fdset __attribute__((unused)))
- {
-   struct mpserver *s = descriptor2mpserver(d);
- 
-@@ -1084,8 +1084,8 @@
- }
- 
- static int
--mpserver_Write(struct fdescriptor *d __unused, struct bundle *bundle __unused,
--               const fd_set *fdset __unused)
-+mpserver_Write(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle __attribute__((unused)),
-+               const fd_set *fdset __attribute__((unused)))
- {
-   /* We never want to write here ! */
-   log_Printf(LogALERT, "mpserver_Write: Internal error: Bad call !\n");
---- a/usr.sbin/ppp/mppe.c
-+++ b/usr.sbin/ppp/mppe.c
-@@ -155,7 +155,7 @@
- }
- 
- static struct mbuf *
--MPPEOutput(void *v, struct ccp *ccp, struct link *l __unused, int pri __unused,
-+MPPEOutput(void *v, struct ccp *ccp, struct link *l __attribute__((unused)), int pri __attribute__((unused)),
- 	   u_short *proto, struct mbuf *mp)
- {
-   struct mppe_state *mop = (struct mppe_state *)v;
-@@ -232,7 +232,7 @@
- }
- 
- static void
--MPPEResetInput(void *v __unused)
-+MPPEResetInput(void *v __attribute__((unused)))
- {
-   log_Printf(LogCCP, "MPPE: Unexpected input channel ack\n");
- }
-@@ -372,8 +372,8 @@
- }
- 
- static void
--MPPEDictSetup(void *v __unused, struct ccp *ccp __unused,
--	      u_short proto __unused, struct mbuf *mp __unused)
-+MPPEDictSetup(void *v __attribute__((unused)), struct ccp *ccp __attribute__((unused)),
-+	      u_short proto __attribute__((unused)), struct mbuf *mp __attribute__((unused)))
- {
-   /* Nothing to see here */
- }
-@@ -470,7 +470,7 @@
- }
- 
- static u_int32_t
--MPPE_ConfigVal(struct bundle *bundle __unused, const struct ccp_config *cfg)
-+MPPE_ConfigVal(struct bundle *bundle __attribute__((unused)), const struct ccp_config *cfg)
- {
-   u_int32_t val;
- 
-@@ -676,7 +676,7 @@
- }
- 
- static void *
--MPPEInitInput(struct bundle *bundle __unused, struct fsm_opt *o)
-+MPPEInitInput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o)
- {
-   struct mppe_state *mip;
- 
-@@ -732,7 +732,7 @@
- }
- 
- static void *
--MPPEInitOutput(struct bundle *bundle __unused, struct fsm_opt *o)
-+MPPEInitOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o)
- {
-   struct mppe_state *mop;
- 
---- a/usr.sbin/ppp/nat_cmd.c
-+++ b/usr.sbin/ppp/nat_cmd.c
-@@ -496,8 +496,8 @@
- }
- 
- static struct mbuf *
--nat_LayerPush(struct bundle *bundle, struct link *l __unused, struct mbuf *bp,
--                int pri __unused, u_short *proto)
-+nat_LayerPush(struct bundle *bundle, struct link *l __attribute__((unused)), struct mbuf *bp,
-+                int pri __attribute__((unused)), u_short *proto)
- {
-   if (!bundle->NatEnabled || *proto != PROTO_IP)
-     return bp;
-@@ -513,7 +513,7 @@
- }
- 
- static struct mbuf *
--nat_LayerPull(struct bundle *bundle, struct link *l __unused, struct mbuf *bp,
-+nat_LayerPull(struct bundle *bundle, struct link *l __attribute__((unused)), struct mbuf *bp,
-                 u_short *proto)
- {
-   static int gfrags;
---- a/usr.sbin/ppp/ncp.c
-+++ b/usr.sbin/ppp/ncp.c
-@@ -146,7 +146,7 @@
- int
- ncp_fsmStart(struct ncp *ncp,
- #ifdef NOINET6
--	     struct bundle *bundle __unused
-+	     struct bundle *bundle __attribute__((unused))
- #else
- 	     struct bundle *bundle
- #endif
-@@ -337,9 +337,9 @@
-  * of what is to be pushed next, coming either from mp->out or ncp->afq.
-  */
- int
--ncp_PushPacket(struct ncp *ncp __unused,
-+ncp_PushPacket(struct ncp *ncp __attribute__((unused)),
- #ifdef NOINET6
--	       int *af __unused,
-+	       int *af __attribute__((unused)),
- #else
- 	       int *af,
- #endif
---- a/usr.sbin/ppp/netgraph.c
-+++ b/usr.sbin/ppp/netgraph.c
-@@ -279,7 +279,7 @@
- 
- static void
- ng_device2iov(struct device *d, struct iovec *iov, int *niov,
--              int maxiov __unused, int *auxfd, int *nauxfd)
-+              int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   struct ngdevice *dev;
-   int sz = physical_MaxDeviceSize();
-@@ -320,7 +320,7 @@
- 
- struct device *
- ng_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
--              int maxiov __unused, int *auxfd, int *nauxfd)
-+              int maxiov __attribute__((unused)), int *auxfd, int *nauxfd)
- {
-   if (type == NG_DEVICE) {
-     struct ngdevice *dev = (struct ngdevice *)iov[(*niov)++].iov_base;
---- a/usr.sbin/ppp/physical.c
-+++ b/usr.sbin/ppp/physical.c
-@@ -397,8 +397,8 @@
- }
- 
- static int
--physical_DescriptorWrite(struct fdescriptor *d, struct bundle *bundle __unused,
--                         const fd_set *fdset __unused)
-+physical_DescriptorWrite(struct fdescriptor *d, struct bundle *bundle __attribute__((unused)),
-+                         const fd_set *fdset __attribute__((unused)))
- {
-   struct physical *p = descriptor2physical(d);
-   int nw, result = 0;
-@@ -530,7 +530,7 @@
- 
- void
- physical_DescriptorRead(struct fdescriptor *d, struct bundle *bundle,
--                     const fd_set *fdset __unused)
-+                     const fd_set *fdset __attribute__((unused)))
- {
-   struct physical *p = descriptor2physical(d);
-   u_char *rbuff;
---- a/usr.sbin/ppp/pred.c
-+++ b/usr.sbin/ppp/pred.c
-@@ -151,7 +151,7 @@
- }
- 
- static void *
--Pred1InitInput(struct bundle *bundle __unused, struct fsm_opt *o __unused)
-+Pred1InitInput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o __attribute__((unused)))
- {
-   struct pred1_state *state;
-   state = (struct pred1_state *)malloc(sizeof(struct pred1_state));
-@@ -161,7 +161,7 @@
- }
- 
- static void *
--Pred1InitOutput(struct bundle *bundle __unused, struct fsm_opt *o __unused)
-+Pred1InitOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o __attribute__((unused)))
- {
-   struct pred1_state *state;
-   state = (struct pred1_state *)malloc(sizeof(struct pred1_state));
-@@ -171,8 +171,8 @@
- }
- 
- static struct mbuf *
--Pred1Output(void *v, struct ccp *ccp, struct link *l __unused,
--	    int pri __unused, u_short *proto, struct mbuf *bp)
-+Pred1Output(void *v, struct ccp *ccp, struct link *l __attribute__((unused)),
-+	    int pri __attribute__((unused)), u_short *proto, struct mbuf *bp)
- {
-   struct pred1_state *state = (struct pred1_state *)v;
-   struct mbuf *mwp;
-@@ -289,28 +289,28 @@
- }
- 
- static void
--Pred1DictSetup(void *v __unused, struct ccp *ccp __unused,
--	       u_short proto __unused, struct mbuf *bp __unused)
-+Pred1DictSetup(void *v __attribute__((unused)), struct ccp *ccp __attribute__((unused)),
-+	       u_short proto __attribute__((unused)), struct mbuf *bp __attribute__((unused)))
- {
-   /* Nothing to see here */
- }
- 
- static const char *
--Pred1DispOpts(struct fsm_opt *o __unused)
-+Pred1DispOpts(struct fsm_opt *o __attribute__((unused)))
- {
-   return NULL;
- }
- 
- static void
--Pred1InitOptsOutput(struct bundle *bundle __unused, struct fsm_opt *o,
--                    const struct ccp_config *cfg __unused)
-+Pred1InitOptsOutput(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o,
-+                    const struct ccp_config *cfg __attribute__((unused)))
- {
-   o->hdr.len = 2;
- }
- 
- static int
--Pred1SetOpts(struct bundle *bundle __unused, struct fsm_opt *o,
--             const struct ccp_config *cfg __unused)
-+Pred1SetOpts(struct bundle *bundle __attribute__((unused)), struct fsm_opt *o,
-+             const struct ccp_config *cfg __attribute__((unused)))
- {
-   if (o->hdr.len != 2) {
-     o->hdr.len = 2;
---- a/usr.sbin/ppp/prompt.c
-+++ b/usr.sbin/ppp/prompt.c
-@@ -129,7 +129,7 @@
- }
- 
- static int
--prompt_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __unused,
-+prompt_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __attribute__((unused)),
- 		 fd_set *e, int *n)
- {
-   struct prompt *p = descriptor2prompt(d);
-@@ -181,7 +181,7 @@
- 
- static void
- prompt_Read(struct fdescriptor *d, struct bundle *bundle,
--	    const fd_set *fdset __unused)
-+	    const fd_set *fdset __attribute__((unused)))
- {
-   struct prompt *p = descriptor2prompt(d);
-   struct prompt *op;
-@@ -302,8 +302,8 @@
- }
- 
- static int
--prompt_Write(struct fdescriptor *d __unused, struct bundle *bundle __unused,
--	     const fd_set *fdset __unused)
-+prompt_Write(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle __attribute__((unused)),
-+	     const fd_set *fdset __attribute__((unused)))
- {
-   /* We never want to write here ! */
-   log_Printf(LogALERT, "prompt_Write: Internal error: Bad call !\n");
---- a/usr.sbin/ppp/proto.c
-+++ b/usr.sbin/ppp/proto.c
-@@ -69,8 +69,8 @@
- }
- 
- static struct mbuf *
--proto_LayerPush(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--                int pri __unused, u_short *proto)
-+proto_LayerPush(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+                int pri __attribute__((unused)), u_short *proto)
- {
-   log_Printf(LogDEBUG, "proto_LayerPush: Using 0x%04x\n", *proto);
-   bp = proto_Prepend(bp, *proto, l->lcp.his_protocomp,
-@@ -82,7 +82,7 @@
- }
- 
- static struct mbuf *
--proto_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
-+proto_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-                 u_short *proto)
- {
-   u_char cp[2];
---- a/usr.sbin/ppp/radius.c
-+++ b/usr.sbin/ppp/radius.c
-@@ -682,8 +682,8 @@
-  * Time to call rad_continue_send_request() - something to read.
-  */
- static void
--radius_Read(struct fdescriptor *d, struct bundle *bundle __unused,
--	    const fd_set *fdset __unused)
-+radius_Read(struct fdescriptor *d, struct bundle *bundle __attribute__((unused)),
-+	    const fd_set *fdset __attribute__((unused)))
- {
-   radius_Continue(descriptor2radius(d), 1);
- }
-@@ -711,8 +711,8 @@
-  * Behave as a struct fdescriptor (descriptor.h)
-  */
- static int
--radius_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __unused,
--		 fd_set *e __unused, int *n)
-+radius_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w __attribute__((unused)),
-+		 fd_set *e __attribute__((unused)), int *n)
- {
-   struct radius *rad = descriptor2radius(d);
- 
-@@ -742,8 +742,8 @@
-  * Behave as a struct fdescriptor (descriptor.h)
-  */
- static int
--radius_Write(struct fdescriptor *d __unused, struct bundle *bundle __unused,
--	     const fd_set *fdset __unused)
-+radius_Write(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle __attribute__((unused)),
-+	     const fd_set *fdset __attribute__((unused)))
- {
-   /* We never want to write here ! */
-   log_Printf(LogALERT, "radius_Write: Internal error: Bad call !\n");
---- a/usr.sbin/ppp/server.c
-+++ b/usr.sbin/ppp/server.c
-@@ -192,8 +192,8 @@
- }
- 
- static int
--server_Write(struct fdescriptor *d __unused, struct bundle *bundle __unused,
--	     const fd_set *fdset __unused)
-+server_Write(struct fdescriptor *d __attribute__((unused)), struct bundle *bundle __attribute__((unused)),
-+	     const fd_set *fdset __attribute__((unused)))
- {
-   /* We never want to write here ! */
-   log_Printf(LogALERT, "server_Write: Internal error: Bad call !\n");
-@@ -384,7 +384,7 @@
- }
- 
- int
--server_Close(struct bundle *bundle __unused)
-+server_Close(struct bundle *bundle __attribute__((unused)))
- {
-   if (server.fd >= 0) {
-     if (*server.cfg.sockname != '\0') {
---- a/usr.sbin/ppp/sync.c
-+++ b/usr.sbin/ppp/sync.c
-@@ -49,8 +49,8 @@
- #include "physical.h"
- 
- static struct mbuf *
--sync_LayerPush(struct bundle *bundle __unused, struct link *l __unused,
--	       struct mbuf *bp, int pri __unused, u_short *proto __unused)
-+sync_LayerPush(struct bundle *bundle __attribute__((unused)), struct link *l __attribute__((unused)),
-+	       struct mbuf *bp, int pri __attribute__((unused)), u_short *proto __attribute__((unused)))
- {
-   log_DumpBp(LogSYNC, "Write", bp);
-   m_settype(bp, MB_SYNCOUT);
-@@ -59,8 +59,8 @@
- }
- 
- static struct mbuf *
--sync_LayerPull(struct bundle *b __unused, struct link *l, struct mbuf *bp,
--               u_short *proto __unused)
-+sync_LayerPull(struct bundle *b __attribute__((unused)), struct link *l, struct mbuf *bp,
-+               u_short *proto __attribute__((unused)))
- {
-   struct physical *p = link2physical(l);
-   int len;
---- a/usr.sbin/ppp/tcp.c
-+++ b/usr.sbin/ppp/tcp.c
-@@ -119,8 +119,8 @@
- 
- struct device *
- tcp_iov2device(int type, struct physical *p, struct iovec *iov,
--               int *niov, int maxiov __unused, int *auxfd __unused,
--	       int *nauxfd __unused)
-+               int *niov, int maxiov __attribute__((unused)), int *auxfd __attribute__((unused)),
-+	       int *nauxfd __attribute__((unused)))
- {
-   if (type == TCP_DEVICE) {
-     free(iov[(*niov)++].iov_base);
---- a/usr.sbin/ppp/tcpmss.c
-+++ b/usr.sbin/ppp/tcpmss.c
-@@ -168,15 +168,15 @@
- }
- 
- static struct mbuf *
--tcpmss_LayerPush(struct bundle *bundle, struct link *l __unused,
--		 struct mbuf *bp, int pri __unused, u_short *proto __unused)
-+tcpmss_LayerPush(struct bundle *bundle, struct link *l __attribute__((unused)),
-+		 struct mbuf *bp, int pri __attribute__((unused)), u_short *proto __attribute__((unused)))
- {
- 	return tcpmss_Check(bundle, bp);
- }
- 
- static struct mbuf *
--tcpmss_LayerPull(struct bundle *bundle, struct link *l __unused,
--		 struct mbuf *bp, u_short *proto __unused)
-+tcpmss_LayerPull(struct bundle *bundle, struct link *l __attribute__((unused)),
-+		 struct mbuf *bp, u_short *proto __attribute__((unused)))
- {
- 	return tcpmss_Check(bundle, bp);
- }
---- a/usr.sbin/ppp/tty.c
-+++ b/usr.sbin/ppp/tty.c
-@@ -573,11 +573,11 @@
- 
- static void
- tty_device2iov(struct device *d, struct iovec *iov, int *niov,
--               int maxiov __unused,
-+               int maxiov __attribute__((unused)),
- #ifndef NONETGRAPH
-                int *auxfd, int *nauxfd
- #else
--               int *auxfd __unused, int *nauxfd __unused
-+               int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused))
- #endif
-                )
- {
-@@ -630,11 +630,11 @@
- 
- struct device *
- tty_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
--               int maxiov __unused,
-+               int maxiov __attribute__((unused)),
- #ifndef NONETGRAPH
-                int *auxfd, int *nauxfd
- #else
--               int *auxfd __unused, int *nauxfd __unused
-+               int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused))
- #endif
-                )
- {
---- a/usr.sbin/ppp/udp.c
-+++ b/usr.sbin/ppp/udp.c
-@@ -138,7 +138,7 @@
- 
- static void
- udp_device2iov(struct device *d, struct iovec *iov, int *niov,
--               int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-+               int maxiov __attribute__((unused)), int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused)))
- {
-   int sz = physical_MaxDeviceSize();
- 
-@@ -174,7 +174,7 @@
- 
- struct device *
- udp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
--               int maxiov __unused, int *auxfd __unused, int *nauxfd __unused)
-+               int maxiov __attribute__((unused)), int *auxfd __attribute__((unused)), int *nauxfd __attribute__((unused)))
- {
-   if (type == UDP_DEVICE) {
-     struct udpdevice *dev = (struct udpdevice *)iov[(*niov)++].iov_base;
---- a/usr.sbin/ppp/vjcomp.c
-+++ b/usr.sbin/ppp/vjcomp.c
-@@ -70,8 +70,8 @@
- #define MAX_VJHEADER 16		/* Maximum size of compressed header */
- 
- static struct mbuf *
--vj_LayerPush(struct bundle *bundle, struct link *l __unused, struct mbuf *bp,
--	     int pri __unused, u_short *proto)
-+vj_LayerPush(struct bundle *bundle, struct link *l __attribute__((unused)), struct mbuf *bp,
-+	     int pri __attribute__((unused)), u_short *proto)
- {
-   int type;
-   struct ip *pip;
-@@ -162,7 +162,7 @@
- }
- 
- static struct mbuf *
--vj_LayerPull(struct bundle *bundle, struct link *l __unused, struct mbuf *bp,
-+vj_LayerPull(struct bundle *bundle, struct link *l __attribute__((unused)), struct mbuf *bp,
-              u_short *proto)
- {
-   u_char type;
---- a/usr.sbin/rpc.lockd/lock_proc.c
-+++ b/usr.sbin/rpc.lockd/lock_proc.c
-@@ -770,7 +770,7 @@
-  */
- void *
- nlm_cancel_res_1_svc(arg, rqstp)
--	nlm_res *arg __unused;
-+	nlm_res *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -803,7 +803,7 @@
-  */
- void *
- nlm_granted_res_1_svc(arg, rqstp)
--	nlm_res *arg __unused;
-+	nlm_res *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -902,7 +902,7 @@
-  */
- void *
- nlm_free_all_3_svc(arg, rqstp)
--	nlm_notify *arg __unused;
-+	nlm_notify *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	static char dummy;
-@@ -1260,7 +1260,7 @@
-  */
- void *
- nlm4_cancel_res_4_svc(arg, rqstp)
--	nlm4_res *arg __unused;
-+	nlm4_res *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1275,7 +1275,7 @@
-  */
- void *
- nlm4_unlock_res_4_svc(arg, rqstp)
--	nlm4_res *arg __unused;
-+	nlm4_res *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1290,7 +1290,7 @@
-  */
- void *
- nlm4_granted_res_4_svc(arg, rqstp)
--	nlm4_res *arg __unused;
-+	nlm4_res *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1389,7 +1389,7 @@
-  */
- void *
- nlm4_free_all_4_svc(arg, rqstp)
--	struct nlm4_notify *arg __unused;
-+	struct nlm4_notify *arg __attribute__((unused));
- 	struct svc_req *rqstp;
- {
- 	static char dummy;
-@@ -1407,7 +1407,7 @@
- void *
- nlm_sm_notify_0_svc(arg, rqstp)
- 	struct nlm_sm_status *arg;
--	struct svc_req *rqstp __unused;
-+	struct svc_req *rqstp __attribute__((unused));
- {
- 	static char dummy;
- 	notify(arg->mon_name, arg->state);
---- a/usr.sbin/rpc.lockd/lockd_lock.c
-+++ b/usr.sbin/rpc.lockd/lockd_lock.c
-@@ -1176,8 +1176,8 @@
- 
- enum hwlock_status
- test_hwlock(fl, conflicting_fl)
--	const struct file_lock *fl __unused;
--	struct file_lock **conflicting_fl __unused;
-+	const struct file_lock *fl __attribute__((unused));
-+	struct file_lock **conflicting_fl __attribute__((unused));
- {
- 
- 	/*
-@@ -1891,7 +1891,7 @@
-  */
- 
- struct nlm4_holder *
--testlock(struct nlm4_lock *lock, bool_t exclusive, int flags __unused)
-+testlock(struct nlm4_lock *lock, bool_t exclusive, int flags __attribute__((unused)))
- {
- 	struct file_lock test_fl, *conflicting_fl;
- 
-@@ -1991,7 +1991,7 @@
- 
- /* unlock a filehandle */
- enum nlm_stats
--unlock(nlm4_lock *lock, const int flags __unused)
-+unlock(nlm4_lock *lock, const int flags __attribute__((unused)))
- {
- 	struct file_lock fl;
- 	enum nlm_stats err;
-@@ -2187,7 +2187,7 @@
- void
- send_granted(fl, opcode)
- 	struct file_lock *fl;
--	int opcode __unused;
-+	int opcode __attribute__((unused));
- {
- 	CLIENT *cli;
- 	static char dummy;
---- a/usr.sbin/rpc.statd/procs.c
-+++ b/usr.sbin/rpc.statd/procs.c
-@@ -257,7 +257,7 @@
- 		earlier call to sm_mon_1
- */
- 
--struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req __unused)
-+struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req __attribute__((unused)))
- {
-   static sm_stat res;
-   HostInfo *hp;
-@@ -295,7 +295,7 @@
- 		host and program number.
- */
- 
--struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req __unused)
-+struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req __attribute__((unused)))
- {
-   static sm_stat res;
-   HostInfo *hp;
-@@ -332,7 +332,7 @@
- 		and inform all hosts on the monitor list.
- */
- 
--void *sm_simu_crash_1_svc(void *v __unused, struct svc_req *req __unused)
-+void *sm_simu_crash_1_svc(void *v __attribute__((unused)), struct svc_req *req __attribute__((unused)))
- {
-   static char dummy;
-   int work_to_do;
-@@ -377,7 +377,7 @@
- 		that modify the list.
- */
- 
--void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req __unused)
-+void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req __attribute__((unused)))
- {
-   struct timeval timeout = { 20, 0 };	/* 20 secs timeout		*/
-   CLIENT *cli;
---- a/usr.sbin/rpc.statd/statd.c
-+++ b/usr.sbin/rpc.statd/statd.c
-@@ -446,7 +446,7 @@
- 		children to exit when they have done their work.
- */
- 
--static void handle_sigchld(int sig __unused)
-+static void handle_sigchld(int sig __attribute__((unused)))
- {
-   int pid, status;
-   pid = wait4(-1, &status, WNOHANG, (struct rusage*)0);
---- a/usr.sbin/powerd/powerd.c
-+++ b/usr.sbin/powerd/powerd.c
-@@ -419,7 +419,7 @@
- }
- 
- static void
--handle_sigs(int __unused sig)
-+handle_sigs(int __attribute__((unused)) sig)
- {
- 
- 	exit_requested = 1;

Modified: trunk/freebsd-utils/debian/patches/002_ifconfig.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/002_ifconfig.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/002_ifconfig.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,61 +1,33 @@
----
- sbin/ifconfig/Makefile      |   23 ++++++++++++-----------
- sbin/ifconfig/af_atalk.c    |    6 +++---
- sbin/ifconfig/af_inet.c     |    4 ++--
- sbin/ifconfig/af_inet6.c    |   17 +++++++++--------
- sbin/ifconfig/af_ipx.c      |    4 ++--
- sbin/ifconfig/af_link.c     |    4 +++-
- sbin/ifconfig/af_nd6.c      |    4 ++--
- sbin/ifconfig/ifcarp.c      |    1 +
- sbin/ifconfig/ifclone.c     |    3 ++-
- sbin/ifconfig/ifconfig.c    |   37 ++++++++++++++++++++++++-------------
- sbin/ifconfig/ifgre.c       |    2 +-
- sbin/ifconfig/ifieee80211.c |    4 ++++
- sbin/ifconfig/ifvlan.c      |    2 ++
- 13 files changed, 67 insertions(+), 44 deletions(-)
-
 --- a/sbin/ifconfig/Makefile
 +++ b/sbin/ifconfig/Makefile
-@@ -21,22 +21,23 @@
- SRCS+=	af_nd6.c		# ND6 support
+@@ -27,20 +27,17 @@
+ .endif
  
  SRCS+=	ifclone.c		# clone device support
 -SRCS+=	ifmac.c			# MAC support
-+#SRCS+=	ifmac.c			# MAC support
  SRCS+=	ifmedia.c		# SIOC[GS]IFMEDIA support
+-SRCS+=	iffib.c			# non-default FIB support
  SRCS+=	ifvlan.c		# SIOC[GS]ETVLAN support
--SRCS+=	ifgre.c			# GRE keys etc
-+#SRCS+=	ifgre.c			# GRE keys etc
+ SRCS+=	ifgre.c			# GRE keys etc
  SRCS+=	ifgif.c			# GIF reversed header workaround
  
  SRCS+=	ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
--DPADD+=	${LIBBSDXML} ${LIBSBUF} ${LIBJAIL}
+ DPADD+=	${LIBBSDXML} ${LIBJAIL} ${LIBSBUF}
 -LDADD+=	-lbsdxml -ljail -lsbuf
-+#DPADD+=	${LIBBSDXML} ${LIBSBUF} ${LIBJAIL}
-+#LDADD+=	-lbsdxml -ljail -lsbuf
-+LDADD+=	-lexpat -lsbuf
-+
-+#SRCS+=	ifcarp.c		# SIOC[GS]VH support
-+#SRCS+=	ifgroup.c		# ...
-+#SRCS+=	ifpfsync.c		# pfsync(4) support
++LDADD+=	-lexpat -ljail -lsbuf
  
--SRCS+=	ifcarp.c		# SIOC[GS]VH support
--SRCS+=	ifgroup.c		# ...
+ SRCS+=	ifcarp.c		# SIOC[GS]VH support
+ SRCS+=	ifgroup.c		# ...
 -SRCS+=	ifpfsync.c		# pfsync(4) support
--
--SRCS+=	ifbridge.c		# bridge support
--SRCS+=	iflagg.c		# lagg support
-+#SRCS+=	ifbridge.c		# bridge support
-+#SRCS+=	iflagg.c		# lagg support
  
- .if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
- SRCS+=	af_ipx.c		# IPX support
-@@ -47,6 +48,7 @@
+ SRCS+=	ifbridge.c		# bridge support
+ SRCS+=	iflagg.c		# lagg support
+@@ -60,6 +57,7 @@
  MAN=	ifconfig.8
  
  CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs
 +LDADD+= -lbsd ../../lib/linkaddr.o
- WARNS?=	0
+ WARNS?=	2
  
  .include <bsd.prog.mk>
 --- a/sbin/ifconfig/ifconfig.c
@@ -71,15 +43,6 @@
  #include <net/ethernet.h>
  #include <net/if.h>
  #include <net/if_var.h>
-@@ -66,7 +70,7 @@
- #include <err.h>
- #include <errno.h>
- #include <fcntl.h>
--#include <jail.h>
-+#include <sys/jail.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
 @@ -156,7 +160,7 @@
  	all = downonly = uponly = namesonly = noload = verbose = 0;
  
@@ -89,105 +52,7 @@
  	for (p = opts; p != NULL; p = p->next)
  		strlcat(options, p->opt, sizeof(options));
  	while ((c = getopt(argc, argv, options)) != -1) {
-@@ -643,8 +647,9 @@
- 		err(1, "SIOCDIFPHYADDR");
- }
- 
-+#if 0
- static void
--setifvnet(const char *jname, int dummy __attribute__((unused)), int s,
-+setifvnet(const char *jname, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	struct ifreq my_ifr;
-@@ -658,7 +663,7 @@
- }
- 
- static void
--setifrvnet(const char *jname, int dummy __attribute__((unused)), int s,
-+setifrvnet(const char *jname, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	struct ifreq my_ifr;
-@@ -671,8 +676,10 @@
- 		err(1, "SIOCSIFRVNET(%d, %s)", my_ifr.ifr_jid, my_ifr.ifr_name);
- }
- 
-+#endif
-+
- static void
--setifnetmask(const char *addr, int dummy __attribute__((unused)), int s,
-+setifnetmask(const char *addr, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL) {
-@@ -682,7 +689,7 @@
- }
- 
- static void
--setifbroadaddr(const char *addr, int dummy __attribute__((unused)), int s,
-+setifbroadaddr(const char *addr, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL)
-@@ -690,7 +697,7 @@
- }
- 
- static void
--setifipdst(const char *addr, int dummy __attribute__((unused)), int s,
-+setifipdst(const char *addr, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	const struct afswtch *inet;
-@@ -723,7 +730,7 @@
- 
- /*ARGSUSED*/
- static void
--setifdstaddr(const char *addr, int param __attribute__((unused)), int s, 
-+setifdstaddr(const char *addr, int param, int s,
-     const struct afswtch *afp)
- {
- 	if (afp->af_getaddr != NULL)
-@@ -783,7 +790,7 @@
- }
- 
- static void
--setifmetric(const char *val, int dummy __attribute__((unused)), int s, 
-+setifmetric(const char *val, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
-@@ -793,7 +800,7 @@
- }
- 
- static void
--setifmtu(const char *val, int dummy __attribute__((unused)), int s, 
-+setifmtu(const char *val, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
-@@ -803,7 +810,7 @@
- }
- 
- static void
--setifname(const char *val, int dummy __attribute__((unused)), int s, 
-+setifname(const char *val, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	char *newname;
-@@ -825,9 +832,10 @@
- 
- /* ARGSUSED */
- static void
--setifdescr(const char *val, int dummy __attribute__((unused)), int s, 
-+setifdescr(const char *val, int dummy, int s,
-     const struct afswtch *afp)
- {
-+
- 	char *newdescr;
- 
- 	ifr.ifr_buffer.length = strlen(val) + 1;
-@@ -902,7 +910,7 @@
+@@ -947,7 +951,7 @@
  	putchar('\n');
  
  	for (;;) {
@@ -196,17 +61,6 @@
  			ifr.ifr_buffer.buffer = descr;
  			ifr.ifr_buffer.length = descrlen;
  			if (ioctl(s, SIOCGIFDESCR, &ifr) == 0) {
-@@ -1113,8 +1121,10 @@
- 	DEF_CMD_ARG2("tunnel",			settunnel),
- 	DEF_CMD("-tunnel", 0,			deletetunnel),
- 	DEF_CMD("deletetunnel", 0,		deletetunnel),
-+#if 0
- 	DEF_CMD_ARG("vnet",			setifvnet),
- 	DEF_CMD_ARG("-vnet",			setifrvnet),
-+#endif
- 	DEF_CMD("link0",	IFF_LINK0,	setifflags),
- 	DEF_CMD("-link0",	-IFF_LINK0,	setifflags),
- 	DEF_CMD("link1",	IFF_LINK1,	setifflags),
 --- a/sbin/ifconfig/af_inet6.c
 +++ b/sbin/ifconfig/af_inet6.c
 @@ -42,7 +42,6 @@
@@ -226,81 +80,9 @@
  
  #include "ifconfig.h"
  
-@@ -73,7 +74,7 @@
- static	char addr_buf[MAXHOSTNAMELEN *2 + 1];	/*for getnameinfo()*/
- 
- static void
--setifprefixlen(const char *addr, int dummy __attribute__((unused)), int s,
-+setifprefixlen(const char *addr, int dummy, int s,
-     const struct afswtch *afp)
- {
-         if (afp->af_getprefix != NULL)
-@@ -82,7 +83,7 @@
- }
- 
- static void
--setip6flags(const char *dummyaddr __attribute__((unused)), int flag, int dummysoc __attribute__((unused)),
-+setip6flags(const char *dummyaddr, int flag, int dummysoc,
-     const struct afswtch *afp)
- {
- 	if (afp->af_af != AF_INET6)
-@@ -117,21 +118,21 @@
- }
- 
- static void
--setip6pltime(const char *seconds, int dummy __attribute__((unused)), int s, 
-+setip6pltime(const char *seconds, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	setip6lifetime("pltime", seconds, s, afp);
- }
- 
- static void
--setip6vltime(const char *seconds, int dummy __attribute__((unused)), int s, 
-+setip6vltime(const char *seconds, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	setip6lifetime("vltime", seconds, s, afp);
- }
- 
- static void
--setip6eui64(const char *cmd, int dummy __attribute__((unused)), int s,
-+setip6eui64(const char *cmd, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	struct ifaddrs *ifap, *ifa;
-@@ -177,7 +178,7 @@
- }
- 
- static void
--in6_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
-+in6_status(int s, const struct ifaddrs *ifa)
- {
- 	struct sockaddr_in6 *sin, null_sin;
- 	struct in6_ifreq ifr6;
-@@ -527,7 +528,7 @@
- };
- 
- static void
--in6_Lopt_cb(const char *optarg __attribute__((unused)))
-+in6_Lopt_cb(const char *optarg)
- {
- 	ip6lifetime++;	/* print IPv6 address lifetime */
- }
---- a/sbin/ifconfig/ifclone.c
-+++ b/sbin/ifconfig/ifclone.c
-@@ -174,7 +174,7 @@
- };
- 
- static void
--clone_Copt_cb(const char *optarg __attribute__((unused)))
-+clone_Copt_cb(const char *optarg)
- {
- 	list_cloners();
- 	exit(0);
 --- a/sbin/ifconfig/af_link.c
 +++ b/sbin/ifconfig/af_link.c
-@@ -46,13 +46,15 @@
+@@ -46,6 +46,8 @@
  #include <net/if_dl.h>
  #include <net/if_types.h>
  #include <net/ethernet.h>
@@ -309,17 +91,9 @@
  
  #include "ifconfig.h"
  
- static struct ifreq link_ridreq;
- 
- static void
--link_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
-+link_status(int s, const struct ifaddrs *ifa)
- {
- 	/* XXX no const 'cuz LLADDR is defined wrong */
- 	struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr;
 --- a/sbin/ifconfig/ifieee80211.c
 +++ b/sbin/ifconfig/ifieee80211.c
-@@ -90,6 +90,9 @@
+@@ -83,6 +83,9 @@
  #include <fcntl.h>
  #include <inttypes.h>
  #include <stdio.h>
@@ -329,35 +103,6 @@
  #include <stdlib.h>
  #include <string.h>
  #include <unistd.h>
---- a/sbin/ifconfig/af_atalk.c
-+++ b/sbin/ifconfig/af_atalk.c
-@@ -55,7 +55,7 @@
- 
- /* XXX  FIXME -- should use strtoul for better parsing. */
- static void
--setatrange(const char *range, int dummy __attribute__((unused)), int s, 
-+setatrange(const char *range, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	u_int	first = 123, last = 123;
-@@ -69,7 +69,7 @@
- }
- 
- static void
--setatphase(const char *phase, int dummy __attribute__((unused)), int s, 
-+setatphase(const char *phase, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	if (!strcmp(phase, "1"))
-@@ -81,7 +81,7 @@
- }
- 
- static void
--at_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
-+at_status(int s, const struct ifaddrs *ifa)
- {
- 	struct sockaddr_at *sat, null_sat;
- 	struct netrange *nr;
 --- a/sbin/ifconfig/af_inet.c
 +++ b/sbin/ifconfig/af_inet.c
 @@ -43,13 +43,13 @@
@@ -375,15 +120,6 @@
  
  #include "ifconfig.h"
  
-@@ -57,7 +57,7 @@
- static struct ifreq in_ridreq;
- 
- static void
--in_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
-+in_status(int s, const struct ifaddrs *ifa)
- {
- 	struct sockaddr_in *sin, null_sin;
- 	
 --- a/sbin/ifconfig/af_ipx.c
 +++ b/sbin/ifconfig/af_ipx.c
 @@ -41,9 +41,9 @@
@@ -397,43 +133,3 @@
  #define IPTUNNEL
  #include <netipx/ipx.h>
  #include <netipx/ipx_if.h>
-@@ -54,7 +54,7 @@
- static struct ifreq ipx_ridreq;
- 
- static void
--ipx_status(int s __attribute__((unused)), const struct ifaddrs *ifa)
-+ipx_status(int s, const struct ifaddrs *ifa)
- {
- 	struct sockaddr_ipx *sipx, null_sipx;
- 
---- a/sbin/ifconfig/ifgre.c
-+++ b/sbin/ifconfig/ifgre.c
-@@ -65,7 +65,7 @@
- }
- 
- static void
--setifgrekey(const char *val, int dummy __attribute__((unused)), int s, 
-+setifgrekey(const char *val, int dummy, int s,
-     const struct afswtch *afp)
- {
- 	uint32_t grekey = atol(val);
---- a/sbin/ifconfig/af_nd6.c
-+++ b/sbin/ifconfig/af_nd6.c
-@@ -65,7 +65,7 @@
- void setnd6defif(const char *, int, int, const struct afswtch *);
- 
- void
--setnd6flags(const char *dummyaddr __attribute__((unused)),
-+setnd6flags(const char *dummyaddr,
- 	int d, int s,
- 	const struct afswtch *afp)
- {
-@@ -89,7 +89,7 @@
- }
- 
- void
--setnd6defif(const char *dummyaddr __attribute__((unused)),
-+setnd6defif(const char *dummyaddr,
- 	int d, int s,
- 	const struct afswtch *afp)
- {

Modified: trunk/freebsd-utils/debian/patches/003_kbdcontrol.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/003_kbdcontrol.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/003_kbdcontrol.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -4,7 +4,7 @@
 
 --- a/usr.sbin/kbdcontrol/kbdcontrol.c
 +++ b/usr.sbin/kbdcontrol/kbdcontrol.c
-@@ -136,7 +136,7 @@
+@@ -138,7 +138,7 @@
  void		set_keyboard(char *device);
  void		set_keyrates(char *opt);
  void		show_kbd_info(void);

Modified: trunk/freebsd-utils/debian/patches/004_kldconfig.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/004_kldconfig.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/004_kldconfig.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,39 +1,27 @@
---- a/sbin/kldconfig/kldconfig.c
-+++ b/sbin/kldconfig/kldconfig.c
-@@ -208,7 +208,7 @@
- 
- /* Remove a path component from the module search path */
- static void
--rempath(struct pathhead *pathq, char *path, int force, int insert __attribute__((unused)))
-+rempath(struct pathhead *pathq, char *path, int force, int insert)
- {
- 	char pathbuf[MAXPATHLEN+1];
- 	struct pathentry *pe;
 --- a/sbin/kldconfig/Makefile
 +++ b/sbin/kldconfig/Makefile
-@@ -29,5 +29,6 @@
+@@ -29,4 +29,6 @@
  PROG=		kldconfig
  MAN=		kldconfig.8
- WARNS?=		5
-+LDADD=		-lbsd
  
++LDADD=		-lbsd
++
  .include <bsd.prog.mk>
 --- a/sbin/kldload/Makefile
 +++ b/sbin/kldload/Makefile
-@@ -29,5 +29,6 @@
+@@ -29,4 +29,6 @@
  PROG=	kldload
  MAN=	kldload.8
- WARNS?=	5
-+LDADD=         -lbsd
  
++LDADD= -lbsd
++
  .include <bsd.prog.mk>
 --- a/sbin/kldunload/Makefile
 +++ b/sbin/kldunload/Makefile
-@@ -28,6 +28,7 @@
- 
+@@ -29,4 +29,6 @@
  PROG=	kldunload
  MAN=	kldunload.8
-+LDADD=         -lbsd
- WARNS?=	6
  
++LDADD+= -lbsd
++
  .include <bsd.prog.mk>

Deleted: trunk/freebsd-utils/debian/patches/005_ktrace.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/005_ktrace.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/005_ktrace.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,15 +0,0 @@
----
- usr.bin/ktrace/ktrace.c |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/usr.bin/ktrace/ktrace.c
-+++ b/usr.bin/ktrace/ktrace.c
-@@ -200,7 +200,7 @@
- }
- 
- static void
--no_ktrace(int sig __attribute__((unused)))
-+no_ktrace(int sig)
- {
-         (void)fprintf(stderr,
- "error:\tktrace() system call not supported in the running kernel\n\tre-compile kernel with 'options KTRACE'\n");

Modified: trunk/freebsd-utils/debian/patches/006_mdconfig.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/006_mdconfig.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/006_mdconfig.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -9,16 +9,16 @@
 
 --- a/sbin/mdconfig/mdconfig.c
 +++ b/sbin/mdconfig/mdconfig.c
-@@ -41,6 +41,7 @@
+@@ -42,6 +42,7 @@
  static int md_find(char *, const char *);
  static int md_query(char *name);
  static int md_list(char *units, int opt);
 +static void mdmaybeload(void);
- static char *geom_config_get(struct gconf *g, char *name);
+ static char *geom_config_get(struct gconf *g, const char *name);
  static void md_prthumanval(char *length);
  
-@@ -269,9 +270,7 @@
- 	}
+@@ -267,9 +268,7 @@
+ 
  	mdio.md_version = MDIOVERSION;
  
 -	if (!kld_isloaded("g_md") && kld_load("geom_md") == -1)
@@ -28,7 +28,7 @@
  	fd = open("/dev/" MDCTL_NAME, O_RDWR, 0);
  	if (fd < 0)
  		err(1, "open(/dev/%s)", MDCTL_NAME);
-@@ -471,3 +470,21 @@
+@@ -492,3 +491,21 @@
  {
  	return (md_list(name, OPT_UNIT));
  }

Modified: trunk/freebsd-utils/debian/patches/007_mount.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/007_mount.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/007_mount.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -21,7 +21,7 @@
  #define MOPT_NOATIME		{ "atime",	1, MNT_NOATIME, 0 }
 --- a/sbin/mount/mount.c
 +++ b/sbin/mount/mount.c
-@@ -160,6 +160,7 @@
+@@ -161,6 +161,7 @@
  static int
  exec_mountprog(const char *name, const char *execname, char *const argv[])
  {
@@ -29,7 +29,7 @@
  	pid_t pid;
  	int status;
  
-@@ -168,13 +169,11 @@
+@@ -169,13 +170,11 @@
  		warn("fork");
  		exit (1);
  	case 0:					/* Child. */
@@ -46,7 +46,7 @@
  		}
  		exit(1);
  	default:				/* Parent. */
-@@ -251,7 +250,7 @@
+@@ -252,7 +251,7 @@
  	options = NULL;
  	vfslist = NULL;
  	vfstype = "ufs";
@@ -55,7 +55,7 @@
  		switch (ch) {
  		case 'a':
  			all = 1;
-@@ -259,9 +258,6 @@
+@@ -260,9 +259,6 @@
  		case 'd':
  			debug = 1;
  			break;
@@ -65,7 +65,7 @@
  		case 'f':
  			init_flags |= MNT_FORCE;
  			break;
-@@ -646,11 +642,13 @@
+@@ -656,11 +652,13 @@
  			(void)printf(", reads: sync %ju async %ju",
  			    (uintmax_t)sfp->f_syncreads,
  			    (uintmax_t)sfp->f_asyncreads);
@@ -79,7 +79,7 @@
  	}
  	(void)printf(")\n");
  }
-@@ -840,7 +838,7 @@
+@@ -858,7 +856,7 @@
  {
  
  	(void)fprintf(stderr, "%s\n%s\n%s\n",
@@ -88,7 +88,7 @@
  "       mount [-dfpruvw] special | node",
  "       mount [-dfpruvw] [-o options] [-t ufs | external_type] special node");
  	exit(1);
-@@ -865,7 +863,7 @@
+@@ -883,7 +881,7 @@
  
  	if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
  	    strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
@@ -99,7 +99,7 @@
  
 --- a/sbin/mount/Makefile
 +++ b/sbin/mount/Makefile
-@@ -8,6 +8,6 @@
+@@ -7,6 +7,6 @@
  # We do NOT install the getmntopts.3 man page.
  
  DPADD=	${LIBUTIL}

Deleted: trunk/freebsd-utils/debian/patches/012_mount_std.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/012_mount_std.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/012_mount_std.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,19 +0,0 @@
----
- sbin/mount_std/mount_std.c |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/sbin/mount_std/mount_std.c
-+++ b/sbin/mount_std/mount_std.c
-@@ -63,10 +63,10 @@
- static char *fsname;
- static volatile sig_atomic_t caughtsig;
- 
--static void usage(void) __dead2;
-+static void usage(void);
- 
- static void
--catchsig(int s __attribute__((unused)))
-+catchsig(int s)
- {
- 	caughtsig = 1;
- }

Modified: trunk/freebsd-utils/debian/patches/013_pf.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/013_pf.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/013_pf.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,86 +1,59 @@
----
- contrib/pf/authpf/authpf.c        |   31 +-
- contrib/pf/ftp-proxy/ftp-proxy.c  |   12 
- contrib/pf/libevent/kqueue.c      |    2 
- contrib/pf/pfctl/parse.y          |   15 -
- contrib/pf/pfctl/pf_print_state.c |   18 +
- contrib/pf/pfctl/pfctl.c          |    8 
- contrib/pf/pfctl/pfctl.h          |    8 
- contrib/pf/pfctl/pfctl_altq.c     |   12 
- contrib/pf/pfctl/pfctl_optimize.c |    2 
- contrib/pf/pfctl/pfctl_parser.c   |   29 +-
- contrib/pf/pfctl/pfctl_parser.h   |    2 
- contrib/pf/pfctl/pfctl_qstats.c   |   10 
- contrib/pf/pflogd/pflogd.c        |   25 -
- contrib/pf/pflogd/pidfile.c       |    2 
- contrib/pf/pflogd/privsep.c       |    6 
- contrib/pf/tftp-proxy/filter.c    |    2 
- sbin/pfctl/Makefile               |    2 
- sbin/pfctl/pf_ruleset.c           |  512 ++++++++++++++++++++++++++++++++++++++
- usr.sbin/authpf/Makefile          |    2 
- 19 files changed, 628 insertions(+), 72 deletions(-)
-
 --- a/contrib/pf/authpf/authpf.c
 +++ b/contrib/pf/authpf/authpf.c
-@@ -33,10 +33,10 @@
- 
- #include <err.h>
- #include <errno.h>
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
+@@ -37,7 +37,7 @@
+ #ifdef __FreeBSD_kernel__
  #include <inttypes.h>
  #endif
 -#include <login_cap.h>
 +//#include <login_cap.h>
  #include <pwd.h>
+ #include <grp.h>
  #include <signal.h>
- #include <stdio.h>
-@@ -70,10 +70,10 @@
- 
- volatile sig_atomic_t	want_death;
- static void		need_death(int signo);
--#ifdef __FreeBSD__
--static __dead2 void	do_death(int);
-+#ifdef __FreeBSD_kernel__
-+static void	do_death(int);
- #else
--static __dead void	do_death(int);
-+static void	do_death(int);
- #endif
- 
- /*
-@@ -93,8 +93,9 @@
+@@ -99,7 +99,6 @@
  	gid_t		 gid;
  	uid_t		 uid;
- 	char		*shell;
-+#if 0
- 	login_cap_t	*lc;
--
-+#endif
- 	config = fopen(PATH_CONFFILE, "r");
- 	if (config == NULL) {
- 		syslog(LOG_ERR, "can not open %s (%m)", PATH_CONFFILE);
-@@ -140,15 +141,16 @@
- 		syslog(LOG_ERR, "cannot find user for uid %u", uid);
+ 	const char	*shell;
+-	login_cap_t	*lc;
+ 
+ 	if (strcmp(__progname, "-authpf-noip") == 0)
+                 user_ip = 0;
+@@ -150,35 +149,19 @@
  		goto die;
  	}
--
-+#if 0
- 	if ((lc = login_getclass(pw->pw_class)) != NULL)
- 		shell = (char *)login_getcapstr(lc, "shell", pw->pw_shell,
- 		    pw->pw_shell);
- 	else
-+#endif
+ 
+-	if ((lc = login_getclass(pw->pw_class)) != NULL)
+-		shell = login_getcapstr(lc, "shell", pw->pw_shell,
+-		    pw->pw_shell);
+-	else
  		shell = pw->pw_shell;
+ 
+-#ifndef __FreeBSD__
+-	login_close(lc);
+-#endif
 -
-+#if 0
- 	login_close(lc);
--
-+#endif
- 	if (strcmp(shell, PATH_AUTHPF_SHELL)) {
+ 	if (strcmp(shell, PATH_AUTHPF_SHELL) && 
+ 	    strcmp(shell, PATH_AUTHPF_SHELL_NOIP)) {
  		syslog(LOG_ERR, "wrong shell for user %s, uid %u",
  		    pw->pw_name, pw->pw_uid);
-@@ -318,7 +320,9 @@
+-#ifdef __FreeBSD__
+-	login_close(lc);
+-#else
+ 		if (shell != pw->pw_shell)
+ 			free(shell);
+-#endif
+ 		goto die;
+ 	}
+ 
+-#ifdef __FreeBSD__
+-	login_close(lc);
+-#else
+ 	if (shell != pw->pw_shell)
+ 		free(shell);
+-#endif
+ 
+ 	/*
+ 	 * Paranoia, but this data _does_ come from outside authpf, and
+@@ -343,7 +326,9 @@
  	while (1) {
  		printf("\r\nHello %s. ", luser);
  		printf("You are authenticated from host \"%s\"\r\n", ipsrc);
@@ -90,59 +63,37 @@
  		print_message(PATH_MESSAGE);
  		while (1) {
  			sleep(10);
-@@ -716,7 +720,7 @@
- 		syslog(LOG_INFO, "allowing %s, user %s", ipsrc, luser);
- 	} else {
- 		gettimeofday(&Tend, NULL);
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		syslog(LOG_INFO, "removed %s, user %s - duration %jd seconds",
- 		    ipsrc, luser, (intmax_t)(Tend.tv_sec - Tstart.tv_sec));
- #else
-@@ -829,10 +833,10 @@
- /*
-  * function that removes our stuff when we go away.
-  */
--#ifdef __FreeBSD__
--static __dead2 void
-+#ifdef __FreeBSD_kernel__
-+static void
- #else
--static __dead void
-+static void
- #endif
- do_death(int active)
- {
+@@ -521,9 +506,6 @@
+ 			}
+ 
+ 			if (buf[0] == '@') {
+-				/* check login class */
+-				if (strcmp(pw->pw_class, buf + 1) == 0)
+-					matched++;
+ 			} else if (buf[0] == '%') {
+ 				/* check group membership */
+ 				int cnt; 
 --- a/contrib/pf/ftp-proxy/ftp-proxy.c
 +++ b/contrib/pf/ftp-proxy/ftp-proxy.c
-@@ -95,7 +95,7 @@
+@@ -104,7 +104,7 @@
  int	drop_privs(void);
  void	end_session(struct session *);
- int	exit_daemon(void);
+ void	exit_daemon(void);
 -int	getline(char *, size_t *);
 +int	bsd_getline(char *, size_t *);
  void	handle_connection(const int, short, void *);
  void	handle_signal(int, short, void *);
  struct session * init_session(void);
-@@ -229,7 +229,7 @@
+@@ -250,7 +250,7 @@
  		    buf_avail);
- 		s->cbuf_valid += read;
+ 		s->cbuf_valid += clientread;
  
 -		while ((n = getline(s->cbuf, &s->cbuf_valid)) > 0) {
 +		while ((n = bsd_getline(s->cbuf, &s->cbuf_valid)) > 0) {
  			logmsg(LOG_DEBUG, "#%d client: %s", s->id, linebuf);
  			if (!client_parse(s)) {
  				end_session(s);
-@@ -305,7 +305,7 @@
- {
- 	struct session *s, *next;
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	LIST_FOREACH_SAFE(s, &sessions, entry, next) {
- #else
- 	for (s = LIST_FIRST(&sessions); s != LIST_END(&sessions); s = next) {
-@@ -324,7 +324,7 @@
+@@ -344,7 +344,7 @@
  }
  
  int
@@ -151,193 +102,25 @@
  {
  	size_t i;
  
-@@ -566,7 +566,7 @@
- 
- 		/* We don't care about truncation. */
- 		vsnprintf(buf, sizeof buf, message, ap);
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		/* XXX: strnvis might be nice to have */
- 		strvisx(visbuf, buf,
- 		    MIN((sizeof(visbuf) / 4) - 1, strlen(buf)),
-@@ -1053,7 +1053,7 @@
+@@ -1088,7 +1088,7 @@
  		    buf_avail);
- 		s->sbuf_valid += read;
+ 		s->sbuf_valid += srvread;
  
 -		while ((n = getline(s->sbuf, &s->sbuf_valid)) > 0) {
 +		while ((n = bsd_getline(s->sbuf, &s->sbuf_valid)) > 0) {
  			logmsg(LOG_DEBUG, "#%d server: %s", s->id, linebuf);
  			if (!server_parse(s)) {
  				end_session(s);
---- a/contrib/pf/libevent/kqueue.c
-+++ b/contrib/pf/libevent/kqueue.c
-@@ -48,7 +48,7 @@
- #include <inttypes.h>
- #endif
- 
--#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
-+#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD_kernel__)
- #define INTPTR(x)	(intptr_t)x
- #else
- #define INTPTR(x)	x
 --- a/contrib/pf/pfctl/parse.y
 +++ b/contrib/pf/pfctl/parse.y
-@@ -62,7 +62,7 @@
- #include "pfctl_parser.h"
- #include "pfctl.h"
- 
--#ifdef __FreeBSD__
-+#ifndef HTONL
- #define	HTONL(x)	(x) = htonl((__uint32_t)(x))
- #endif
- 
-@@ -402,6 +402,7 @@
+@@ -423,6 +423,7 @@
  	} v;
  	int lineno;
  } YYSTYPE;
 +#define YYSTYPE_IS_DECLARED 1
  
- #define DYNIF_MULTIADDR(addr) ((addr).type == PF_ADDR_DYNIFTL && \
- 	(!((addr).iflags & PFI_AFLAG_NOALIAS) ||		 \
-@@ -1027,7 +1028,7 @@
- 			scrub_opts.randomid = 1;
- 		}
- 		| RTABLE number				{
--#ifndef __FreeBSD__
-+#ifndef __FreeBSD_kernel__
- 			if ($2 > RT_TABLEID_MAX || $2 < 0) {
- 				yyerror("invalid rtable id");
- 				YYERROR;
-@@ -1172,7 +1173,7 @@
- 			antispoof_opts.label = $1;
- 		}
- 		| RTABLE number				{
--#ifndef __FreeBSD__
-+#ifndef __FreeBSD_kernel__
- 			if ($2 > RT_TABLEID_MAX || $2 < 0) {
- 				yyerror("invalid rtable id");
- 				YYERROR;
-@@ -2155,7 +2156,7 @@
- 			free($2);
- 		}
- 		| RTABLE number				{
--#ifndef __FreeBSD__
-+#ifndef __FreeBSD_kernel__
- 			if ($2 > RT_TABLEID_MAX || $2 < 0) {
- 				yyerror("invalid rtable id");
- 				YYERROR;
-@@ -3468,7 +3469,7 @@
- 		}
- 		;
- 
--/* ifdef __FreeBSD__ */
-+/* ifdef __FreeBSD_kernel__ */
- natpass		: /* empty */	{ $$.b1 = $$.b2 = 0; $$.w2 = 0; }
- 		| PASS		{ $$.b1 = 1; $$.b2 = 0; $$.w2 = 0; }
- /* else 
-@@ -3842,7 +3843,7 @@
- 
- rtable		: /* empty */		{ $$ = -1; }
- 		| RTABLE number		{
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 			yyerror("rtable id not supported in FreeBSD, yet");
- 			YYERROR;
- #else
---- a/contrib/pf/pfctl/pfctl_altq.c
-+++ b/contrib/pf/pfctl/pfctl_altq.c
-@@ -77,7 +77,7 @@
- 			     double);
- static double		 sc_x2y(struct service_curve *, double);
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- u_int32_t	 getifspeed(int, char *);
- #else
- u_int32_t	 getifspeed(char *);
-@@ -153,7 +153,7 @@
- 		return;
- 	}
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	if (a->local_flags & PFALTQ_FLAG_IF_REMOVED)
- 		printf("INACTIVE ");
- #endif
-@@ -191,7 +191,7 @@
- {
- 	unsigned	i;
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	if (a->local_flags & PFALTQ_FLAG_IF_REMOVED)
- 		printf("INACTIVE ");
- #endif
-@@ -237,7 +237,7 @@
- 	if (bw->bw_absolute > 0)
- 		pa->ifbandwidth = bw->bw_absolute;
- 	else
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) {
- #else
- 		if ((rate = getifspeed(pa->ifname)) == 0) {
-@@ -1096,7 +1096,7 @@
- 	return (buf);
- }
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- /*
-  * XXX
-  * FreeBSD does not have SIOCGIFDATA.
-@@ -1153,7 +1153,7 @@
- 	    sizeof(ifr.ifr_name))
- 		errx(1, "getifmtu: strlcpy");
- 	if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == -1)
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		ifr.ifr_mtu = 1500;
- #else
- 		err(1, "SIOCGIFMTU");
---- a/contrib/pf/pfctl/pfctl.c
-+++ b/contrib/pf/pfctl/pfctl.c
-@@ -59,7 +59,7 @@
- #include "pfctl_parser.h"
- #include "pfctl.h"
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- #define HTONL(x)	(x) = htonl((__uint32_t)(x))
- #endif
- 
-@@ -250,7 +250,7 @@
- 	if (ioctl(dev, DIOCSTART)) {
- 		if (errno == EEXIST)
- 			errx(1, "pf already enabled");
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		else if (errno == ESRCH)
- 			errx(1, "pfil registeration failed");
- #endif
-@@ -1895,7 +1895,7 @@
- int
- pfctl_test_altqsupport(int dev, int opts)
- {
--#if defined(__FreeBSD__) && !defined(ENABLE_ALTQ)
-+#if defined(__FreeBSD_kernel__) && !defined(ENABLE_ALTQ)
- 	return (0);
- #else
- 	struct pfioc_altq pa;
-@@ -2171,7 +2171,7 @@
- 		/* turn off options */
- 		opts &= ~ (PF_OPT_DISABLE | PF_OPT_ENABLE);
- 		clearopt = showopt = debugopt = NULL;
--#if defined(__FreeBSD__) && !defined(ENABLE_ALTQ)
-+#if defined(__FreeBSD_kernel__) && !defined(ENABLE_ALTQ)
- 		altqsupport = 0;
- #else
- 		altqsupport = 1;
+ #define PPORT_RANGE	1
+ #define PPORT_STAR	2
 --- a/contrib/pf/pfctl/pfctl.h
 +++ b/contrib/pf/pfctl/pfctl.h
 @@ -36,6 +36,12 @@
@@ -353,34 +136,14 @@
  enum {	PFRB_TABLES = 1, PFRB_TSTATS, PFRB_ADDRS, PFRB_ASTATS,
  	PFRB_IFACES, PFRB_TRANS, PFRB_MAX };
  struct pfr_buffer {
-@@ -89,7 +95,7 @@
- int	 pfctl_show_ifaces(const char *, int);
- FILE	*pfctl_fopen(const char *, const char *);
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- extern int altqsupport;
- #endif
- 
---- a/contrib/pf/pfctl/pfctl_optimize.c
-+++ b/contrib/pf/pfctl/pfctl_optimize.c
-@@ -860,7 +860,7 @@
- 				break;
- 			}
- 		}
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		if (por2 == NULL)
- #else
- 		if (por2 == TAILQ_END(&block->sb_rules))
 --- a/contrib/pf/pfctl/pfctl_parser.c
 +++ b/contrib/pf/pfctl/pfctl_parser.c
-@@ -60,6 +60,28 @@
+@@ -59,6 +59,28 @@
  #include <ifaddrs.h>
  #include <unistd.h>
  
-+//#include <bsd/bsd.h>
 +
++
 +/* RFC2292 decls */
 +#define ICMP6_MEMBERSHIP_QUERY          130     /* group membership query */
 +#define ICMP6_MEMBERSHIP_REPORT         131     /* group membership report */
@@ -404,282 +167,9 @@
  #include "pfctl_parser.h"
  #include "pfctl.h"
  
-@@ -598,7 +620,7 @@
- 		printf("Limit Counters\n");
- 		for (i = 0; i < LCNT_MAX; i++) {
- 			printf("  %-25s %14lld ", pf_lcounters[i],
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 				    (unsigned long long)s->lcounters[i]);
- #else
- 				    s->lcounters[i]);
-@@ -647,7 +669,7 @@
- 			    sn->expire, min, sec);
- 		}
- 		printf(", %llu pkts, %llu bytes",
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		    (unsigned long long)(sn->packets[0] + sn->packets[1]),
- 		    (unsigned long long)(sn->bytes[0] + sn->bytes[1]));
- #else
---- a/contrib/pf/pfctl/pfctl_parser.h
-+++ b/contrib/pf/pfctl/pfctl_parser.h
-@@ -158,7 +158,7 @@
- 	}			 data;
- };
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- /*
-  * XXX
-  * Absolutely this is not correct location to define this.
---- a/contrib/pf/pfctl/pfctl_qstats.c
-+++ b/contrib/pf/pfctl/pfctl_qstats.c
-@@ -89,7 +89,7 @@
- 	struct pf_altq_node	*root = NULL, *node;
- 	int			 nodes, dotitle = (opts & PF_OPT_SHOWALL);
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	if (!altqsupport)
- 		return (-1);
- #endif
-@@ -118,7 +118,7 @@
- 		for (node = root; node != NULL; node = node->next) {
- 			if (iface != NULL && strcmp(node->altq.ifname, iface))
- 				continue;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 			if (node->altq.local_flags & PFALTQ_FLAG_IF_REMOVED)
- 				continue;
- #endif
-@@ -161,7 +161,7 @@
- 			warn("DIOCGETALTQ");
- 			return (-1);
- 		}
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		if (pa.altq.qid > 0 &&
- 		    !(pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED)) {
- #else
-@@ -184,7 +184,7 @@
- 				pfctl_insert_altq_node(root, pa.altq, qstats);
- 			}
- 		}
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		  else if (pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED) {
- 		  	memset(&qstats.data, 0, sizeof(qstats.data));
- 			if ((node = pfctl_find_altq_node(*root, pa.altq.qname,
-@@ -302,7 +302,7 @@
- {
- 	if (a->altq.qid == 0)
- 		return;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	if (a->altq.local_flags & PFALTQ_FLAG_IF_REMOVED)
- 		return;
- #endif
---- a/contrib/pf/pfctl/pf_print_state.c
-+++ b/contrib/pf/pfctl/pf_print_state.c
-@@ -35,7 +35,21 @@
- 
- #include <sys/types.h>
- #include <sys/socket.h>
-+
-+#ifdef __GLIBC__
-+#include <stdint.h>
-+#include <endian.h>
-+#include <byteswap.h>
-+# if __BYTE_ORDER == __LITTLE_ENDIAN
-+# define be64toh(x) bswap_64(x)
-+# elif __BYTE_ORDER == __BIG_ENDIAN
-+# define be64toh(x) ((uint64_t)(x))
-+# else
-+# error Unknown endian
-+# endif
-+#else
- #include <sys/endian.h>
-+#endif
- #include <net/if.h>
- #define TCPSTATES
- #include <netinet/tcp_fsm.h>
-@@ -282,7 +296,7 @@
- 		s->expire /= 60;
- 		printf(", expires in %.2u:%.2u:%.2u", s->expire, min, sec);
- 		printf(", %llu:%llu pkts, %llu:%llu bytes",
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		    (unsigned long long)s->packets[0],
- 		    (unsigned long long)s->packets[1],
- 		    (unsigned long long)s->bytes[0],
-@@ -304,7 +318,7 @@
- 	}
- 	if (opts & PF_OPT_VERBOSE2) {
- 		printf("   id: %016llx creatorid: %08x%s\n",
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		    (unsigned long long)be64toh(s->id), ntohl(s->creatorid),
- #else
- 		    betoh64(s->id), ntohl(s->creatorid),
---- a/contrib/pf/pflogd/pflogd.c
-+++ b/contrib/pf/pflogd/pflogd.c
-@@ -37,7 +37,7 @@
- #include <sys/ioctl.h>
- #include <sys/file.h>
- #include <sys/stat.h>
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- #include <net/bpf.h>	/* BIOCLOCK */
- #endif
- #include <stdio.h>
-@@ -51,7 +51,7 @@
- #include <errno.h>
- #include <stdarg.h>
- #include <fcntl.h>
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- #include "pidfile.h"
- #else
- #include <util.h>
-@@ -158,11 +158,6 @@
- 	va_end(ap);
- }
- 
--#ifdef __FreeBSD__
--__dead2 void
--#else
--__dead void
--#endif
- usage(void)
- {
- 	fprintf(stderr, "usage: pflogd [-Dx] [-d delay] [-f filename]");
-@@ -352,7 +347,7 @@
- scan_dump(FILE *fp, off_t size)
- {
- 	struct pcap_file_header hdr;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	struct pcap_sf_pkthdr ph;
- #else
- 	struct pcap_pkthdr ph;
-@@ -425,7 +420,7 @@
- dump_packet_nobuf(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
- {
- 	FILE *f = (FILE *)user;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	struct pcap_sf_pkthdr sh;
- #endif
- 
-@@ -434,7 +429,7 @@
- 		return;
- 	}
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	sh.ts.tv_sec = (bpf_int32)h->ts.tv_sec;
- 	sh.ts.tv_usec = (bpf_int32)h->ts.tv_usec;
- 	sh.caplen = h->caplen;
-@@ -447,7 +442,7 @@
- 		off_t pos = ftello(f);
- 
- 		/* try to undo header to prevent corruption */
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		if (pos < sizeof(sh) ||
- 		    ftruncate(fileno(f), pos - sizeof(sh))) {
- #else
-@@ -522,7 +517,7 @@
- dump_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
- {
- 	FILE *f = (FILE *)user;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	struct pcap_sf_pkthdr sh;
- 	size_t len = sizeof(sh) + h->caplen;
- #else
-@@ -555,7 +550,7 @@
- 	}
- 
-  append:	
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
-  	sh.ts.tv_sec = (bpf_int32)h->ts.tv_sec;
-  	sh.ts.tv_usec = (bpf_int32)h->ts.tv_usec;
- 	sh.caplen = h->caplen;
-@@ -583,7 +578,7 @@
- 	pcap_handler phandler = dump_packet;
- 	const char *errstr = NULL;
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	/* another ?paranoid? safety measure we do not have */
- #else
- 	closefrom(STDERR_FILENO + 1);
-@@ -690,7 +685,7 @@
- 		np = pcap_dispatch(hpcap, PCAP_NUM_PKTS,
- 		    phandler, (u_char *)dpcap);
- 		if (np < 0) {
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 			if (errno == ENXIO) {
- 				logmsg(LOG_ERR,
- 				    "Device not/no longer configured");
---- a/contrib/pf/pflogd/pidfile.c
-+++ b/contrib/pf/pflogd/pidfile.c
-@@ -48,7 +48,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- #include "pidfile.h"
- #else
- #include <util.h>
---- a/contrib/pf/pflogd/privsep.c
-+++ b/contrib/pf/pflogd/privsep.c
-@@ -31,7 +31,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <limits.h>
--#ifndef __FreeBSD__
-+#ifndef __FreeBSD_kernel__
- #include <pcap.h>
- #include <pcap-int.h>
- #endif
-@@ -40,7 +40,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- /* XXX: pcap pollutes namespace with strlcpy if not present previously */
- #include <pcap.h>
- #include <pcap-int.h>
-@@ -79,7 +79,7 @@
- 	int snaplen, ret, olderrno;
- 	struct passwd *pw;
- 
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 	for (i = 1; i < NSIG; i++)
- #else
- 	for (i = 1; i < _NSIG; i++)
---- a/contrib/pf/tftp-proxy/filter.c
-+++ b/contrib/pf/tftp-proxy/filter.c
-@@ -298,7 +298,7 @@
- 		pfr.rule.quick = 1;
- 		pfr.rule.log = rule_log;
- 		pfr.rule.keep_state = 1;
--#ifdef __FreeBSD__
-+#ifdef __FreeBSD_kernel__
- 		pfr.rule.flags = (proto == IPPROTO_TCP ? TH_SYN : 0);
- 		pfr.rule.flagset = (proto == IPPROTO_TCP ?
- 		    (TH_SYN|TH_ACK|TH_FIN|TH_RST) : 0);
 --- a/sbin/pfctl/Makefile
 +++ b/sbin/pfctl/Makefile
-@@ -21,7 +21,7 @@
+@@ -22,7 +22,7 @@
  
  YFLAGS=
  
@@ -695,7 +185,7 @@
  CFLAGS+= -DENABLE_ALTQ
  
 -LDADD+= -lm -lmd -lutil
-+LDADD+= -lm -lutil -lbsd
++LDADD+= -lm -lbsd -lutil
  DPADD+= ${LIBM} ${LIBMD} ${LIBUTIL}
  
- .include <bsd.prog.mk>
+ WARNS?=	3

Modified: trunk/freebsd-utils/debian/patches/014_route.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/014_route.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/014_route.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -5,7 +5,7 @@
 
 --- a/sbin/route/route.c
 +++ b/sbin/route/route.c
-@@ -63,10 +63,13 @@
+@@ -64,10 +64,13 @@
  #include <paths.h>
  #include <stdio.h>
  #include <stdlib.h>
@@ -18,19 +18,10 @@
 +#include "../../lib/linkaddr.h"
  
  struct keytab {
- 	char	*kt_cp;
-@@ -110,7 +113,7 @@
- int	prefixlen();
- extern	char *iso_ntoa();
- 
--void usage(const char *) __dead2;
-+void usage(const char *);
- 
- void
- usage(cp)
-@@ -134,7 +137,7 @@
+ 	const char	*kt_cp;
+@@ -148,7 +151,7 @@
  	if (argc < 2)
- 		usage((char *)NULL);
+ 		usage(NULL);
  
 -	while ((ch = getopt(argc, argv, "nqdtv")) != -1)
 +	while ((ch = getopt(argc, argv, "+nqdtv")) != -1)
@@ -42,7 +33,7 @@
 @@ -7,6 +7,7 @@
  MAN=	route.8
  SRCS=	route.c keywords.h
- WARNS?=	0
+ WARNS?=	3
 +LDADD= ../../lib/linkaddr.o
  CLEANFILES+=keywords.h _keywords.tmp
  

Modified: trunk/freebsd-utils/debian/patches/016_swapon.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/016_swapon.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/016_swapon.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -57,9 +57,9 @@
  	}
 --- a/sbin/swapon/Makefile
 +++ b/sbin/swapon/Makefile
-@@ -9,6 +9,6 @@
- MLINKS+=swapon.8 swapctl.8
+@@ -10,6 +10,6 @@
  
+ WARNS?=	3
  DPADD=	${LIBUTIL}
 -LDADD=	-lutil
 +LDADD=	-lbsd -lutil

Modified: trunk/freebsd-utils/debian/patches/017_sysctl.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/017_sysctl.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/017_sysctl.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -12,7 +12,7 @@
  
  static int	aflag, bflag, dflag, eflag, hflag, iflag;
  static int	Nflag, nflag, oflag, qflag, xflag, warncount;
-@@ -346,6 +347,7 @@
+@@ -354,6 +355,7 @@
  static int
  S_loadavg(int l2, void *p)
  {
@@ -20,7 +20,7 @@
  	struct loadavg *tv = (struct loadavg*)p;
  
  	if (l2 != sizeof(*tv)) {
-@@ -356,6 +358,7 @@
+@@ -364,6 +366,7 @@
  		(double)tv->ldavg[0]/(double)tv->fscale,
  		(double)tv->ldavg[1]/(double)tv->fscale,
  		(double)tv->ldavg[2]/(double)tv->fscale);

Modified: trunk/freebsd-utils/debian/patches/018_umount.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/018_umount.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/018_umount.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -5,8 +5,8 @@
 
 --- a/sbin/umount/umount.c
 +++ b/sbin/umount/umount.c
-@@ -94,7 +94,7 @@
- 	sync();
+@@ -91,7 +91,7 @@
+ 	struct addrinfo hints;
  
  	all = errs = 0;
 -	while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1)
@@ -14,7 +14,7 @@
  		switch (ch) {
  		case 'A':
  			all = 2;
-@@ -102,9 +102,6 @@
+@@ -99,9 +99,6 @@
  		case 'a':
  			all = 1;
  			break;
@@ -24,7 +24,7 @@
  		case 'f':
  			fflag = MNT_FORCE;
  			break;
-@@ -160,7 +157,7 @@
+@@ -163,7 +160,7 @@
  		break;
  	case 1:
  		if (setfsent() == 0)
@@ -33,18 +33,8 @@
  		errs = umountall(typelist);
  		break;
  	case 0:
-@@ -199,9 +196,6 @@
- 		    strcmp(fs->fs_type, FSTAB_RO) &&
- 		    strcmp(fs->fs_type, FSTAB_RQ))
- 			continue;
--		/* Ignore unknown file system types. */
--		if (getvfsbyname(fs->fs_vfstype, &vfc) == -1)
--			continue;
- 		if (checkvfsname(fs->fs_vfstype, typelist))
- 			continue;
+@@ -361,24 +358,12 @@
  
-@@ -358,24 +352,12 @@
- 
  	if (!namematch(ai))
  		return (1);
 -	/* First try to unmount using the file system ID. */
@@ -70,7 +60,7 @@
  	/* Mark this this file system as unmounted. */
  	getmntentry(NULL, NULL, &sfs->f_fsid, REMOVE);
  	if (vflag)
-@@ -392,7 +374,7 @@
+@@ -395,7 +380,7 @@
  			    clnt_spcreateerror("MOUNTPROG"));
  			return (1);
  		}
@@ -79,10 +69,10 @@
  		try.tv_sec = 20;
  		try.tv_usec = 0;
  		clnt_stat = clnt_call(clp, MOUNTPROC_UMNT, (xdrproc_t)xdr_dir,
-@@ -600,6 +582,6 @@
+@@ -603,6 +588,6 @@
  
  	(void)fprintf(stderr, "%s\n%s\n",
- 	    "usage: umount [-fv] special | node | fsid",
+ 	    "usage: umount [-fv] special ... | node ... | fsid ...",
 -	    "       umount -a | -A [-F fstab] [-fv] [-h host] [-t type]");
 +	    "       umount -a | -A [-fv] [-h host] [-t type]");
  	exit(1);
@@ -90,7 +80,7 @@
 --- a/sbin/umount/umount.8
 +++ b/sbin/umount/umount.8
 @@ -40,7 +40,6 @@
- .Ar special | node | fsid
+ .Ar special ... | node ... | fsid ...
  .Nm
  .Fl a | A
 -.Op Fl F Ar fstab

Modified: trunk/freebsd-utils/debian/patches/021_netstat.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/021_netstat.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/021_netstat.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -29,187 +29,9 @@
  #define	KERNEL 1
  #include <netinet6/ip6_mroute.h>
  #undef KERNEL
---- a/usr.bin/netstat/main.c
-+++ b/usr.bin/netstat/main.c
-@@ -75,118 +75,118 @@
- 
- static struct nlist nl[] = {
- #define	N_IFNET		0
--	{ .n_name = "_ifnet" },
-+	{ { .n_name = "_ifnet" } },
- #define	N_RTSTAT	1
--	{ .n_name = "_rtstat" },
-+	{ { .n_name = "_rtstat" } },
- #define	N_RTREE		2
--	{ .n_name = "_rt_tables"},
-+	{ { .n_name = "_rt_tables"} },
- #define	N_MRTSTAT	3
--	{ .n_name = "_mrtstat" },
-+	{ { .n_name = "_mrtstat" } },
- #define	N_MFCHASHTBL	4
--	{ .n_name = "_mfchashtbl" },
-+	{ { .n_name = "_mfchashtbl" } },
- #define	N_VIFTABLE	5
--	{ .n_name = "_viftable" },
-+	{ { .n_name = "_viftable" } },
- #define	N_IPX		6
--	{ .n_name = "_ipxpcb_list"},
-+	{ { .n_name = "_ipxpcb_list"} },
- #define	N_IPXSTAT	7
--	{ .n_name = "_ipxstat"},
-+	{ { .n_name = "_ipxstat"} },
- #define	N_SPXSTAT	8
--	{ .n_name = "_spx_istat"},
-+	{ { .n_name = "_spx_istat"} },
- #define	N_DDPSTAT	9
--	{ .n_name = "_ddpstat"},
-+	{ { .n_name = "_ddpstat"} },
- #define	N_DDPCB		10
--	{ .n_name = "_ddpcb"},
-+	{ { .n_name = "_ddpcb"} },
- #define	N_NGSOCKS	11
--	{ .n_name = "_ngsocklist"},
-+	{ { .n_name = "_ngsocklist"} },
- #define	N_IP6STAT	12
--	{ .n_name = "_ip6stat" },
-+	{ { .n_name = "_ip6stat" } },
- #define	N_ICMP6STAT	13
--	{ .n_name = "_icmp6stat" },
-+	{ { .n_name = "_icmp6stat" } },
- #define	N_IPSECSTAT	14
--	{ .n_name = "_ipsec4stat" },
-+	{ { .n_name = "_ipsec4stat" } },
- #define	N_IPSEC6STAT	15
--	{ .n_name = "_ipsec6stat" },
-+	{ { .n_name = "_ipsec6stat" } },
- #define	N_PIM6STAT	16
--	{ .n_name = "_pim6stat" },
-+	{ { .n_name = "_pim6stat" } },
- #define	N_MRT6STAT	17
--	{ .n_name = "_mrt6stat" },
-+	{ { .n_name = "_mrt6stat" } },
- #define	N_MF6CTABLE	18
--	{ .n_name = "_mf6ctable" },
-+	{ { .n_name = "_mf6ctable" } },
- #define	N_MIF6TABLE	19
--	{ .n_name = "_mif6table" },
-+	{ { .n_name = "_mif6table" } },
- #define	N_PFKEYSTAT	20
--	{ .n_name = "_pfkeystat" },
-+	{ { .n_name = "_pfkeystat" } },
- #define	N_MBSTAT	21
--	{ .n_name = "_mbstat" },
-+	{ { .n_name = "_mbstat" } },
- #define	N_MBTYPES	22
--	{ .n_name = "_mbtypes" },
-+	{ { .n_name = "_mbtypes" } },
- #define	N_NMBCLUSTERS	23
--	{ .n_name = "_nmbclusters" },
-+	{ { .n_name = "_nmbclusters" } },
- #define	N_NMBUFS	24
--	{ .n_name = "_nmbufs" },
-+	{ { .n_name = "_nmbufs" } },
- #define	N_MBHI		25
--	{ .n_name = "_mbuf_hiwm" },
-+	{ { .n_name = "_mbuf_hiwm" } },
- #define	N_CLHI		26
--	{ .n_name = "_clust_hiwm" },
-+	{ { .n_name = "_clust_hiwm" } },
- #define	N_NCPUS		27
--	{ .n_name = "_smp_cpus" },
-+	{ { .n_name = "_smp_cpus" } },
- #define	N_PAGESZ	28
--	{ .n_name = "_pagesize" },
-+	{ { .n_name = "_pagesize" } },
- #define	N_MBPSTAT	29
--	{ .n_name = "_mb_statpcpu" },
-+	{ { .n_name = "_mb_statpcpu" } },
- #define	N_RTTRASH	30
--	{ .n_name = "_rttrash" },
-+	{ { .n_name = "_rttrash" } },
- #define	N_MBLO		31
--	{ .n_name = "_mbuf_lowm" },
-+	{ { .n_name = "_mbuf_lowm" } },
- #define	N_CLLO		32
--	{ .n_name = "_clust_lowm" },
-+	{ { .n_name = "_clust_lowm" } },
- #define	N_CARPSTAT	33
--	{ .n_name = "_carpstats" },
-+	{ { .n_name = "_carpstats" } },
- #define	N_PFSYNCSTAT	34
--	{ .n_name = "_pfsyncstats" },
-+	{ { .n_name = "_pfsyncstats" } },
- #define	N_AHSTAT	35
--	{ .n_name = "_ahstat" },
-+	{ { .n_name = "_ahstat" } },
- #define	N_ESPSTAT	36
--	{ .n_name = "_espstat" },
-+	{ { .n_name = "_espstat" } },
- #define	N_IPCOMPSTAT	37
--	{ .n_name = "_ipcompstat" },
-+	{ { .n_name = "_ipcompstat" } },
- #define	N_TCPSTAT	38
--	{ .n_name = "_tcpstat" },
-+	{ { .n_name = "_tcpstat" } },
- #define	N_UDPSTAT	39
--	{ .n_name = "_udpstat" },
-+	{ { .n_name = "_udpstat" } },
- #define	N_IPSTAT	40
--	{ .n_name = "_ipstat" },
-+	{ { .n_name = "_ipstat" } },
- #define	N_ICMPSTAT	41
--	{ .n_name = "_icmpstat" },
-+	{ { .n_name = "_icmpstat" } },
- #define	N_IGMPSTAT	42
--	{ .n_name = "_igmpstat" },
-+	{ { .n_name = "_igmpstat" } },
- #define	N_PIMSTAT	43
--	{ .n_name = "_pimstat" },
-+	{ { .n_name = "_pimstat" } },
- #define	N_TCBINFO	44
--	{ .n_name = "_tcbinfo" },
-+	{ { .n_name = "_tcbinfo" } },
- #define	N_UDBINFO	45
--	{ .n_name = "_udbinfo" },
-+	{ { .n_name = "_udbinfo" } },
- #define	N_DIVCBINFO	46
--	{ .n_name = "_divcbinfo" },
-+	{ { .n_name = "_divcbinfo" } },
- #define	N_RIPCBINFO	47
--	{ .n_name = "_ripcbinfo" },
-+	{ { .n_name = "_ripcbinfo" } },
- #define	N_UNP_COUNT	48
--	{ .n_name = "_unp_count" },
-+	{ { .n_name = "_unp_count" } },
- #define	N_UNP_GENCNT	49
--	{ .n_name = "_unp_gencnt" },
-+	{ { .n_name = "_unp_gencnt" } },
- #define	N_UNP_DHEAD	50
--	{ .n_name = "_unp_dhead" },
-+	{ { .n_name = "_unp_dhead" } },
- #define	N_UNP_SHEAD	51
--	{ .n_name = "_unp_shead" },
-+	{ { .n_name = "_unp_shead" } },
- #define	N_RIP6STAT	52
--	{ .n_name = "_rip6stat" },
-+	{ { .n_name = "_rip6stat" } },
- #define	N_SCTPSTAT	53
--	{ .n_name = "_sctpstat" },
-+	{ { .n_name = "_sctpstat" } },
- #define	N_MFCTABLESIZE	54
--	{ .n_name = "_mfctablesize" },
-+	{ { .n_name = "_mfctablesize" } },
- #define N_ARPSTAT       55
--	{ .n_name = "_arpstat" },
--	{ .n_name = NULL },
-+	{ { .n_name = "_arpstat" } },
-+	{ { .n_name = NULL } },
- };
- 
- struct protox {
 --- a/usr.bin/netstat/netstat.h
 +++ b/usr.bin/netstat/netstat.h
-@@ -35,6 +35,19 @@
+@@ -31,6 +31,19 @@
   */
  
  #include <sys/cdefs.h>
@@ -231,7 +53,7 @@
  extern int	aflag;	/* show all sockets (including servers) */
 --- a/usr.bin/netstat/Makefile
 +++ b/usr.bin/netstat/Makefile
-@@ -22,6 +22,7 @@
+@@ -26,6 +26,7 @@
  BINMODE=2555
  DPADD=	${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL}
  LDADD=	-lkvm -lmemstat -lutil

Modified: trunk/freebsd-utils/debian/patches/022_devd.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/022_devd.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/022_devd.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -19,7 +19,7 @@
  
 --- a/sbin/devd/Makefile
 +++ b/sbin/devd/Makefile
-@@ -10,7 +10,7 @@
+@@ -9,7 +9,7 @@
  NO_SHARED?=YES
  
  DPADD=	${LIBL} ${LIBUTIL}
@@ -39,21 +39,15 @@
  
  # NB: All regular expressions have an implicit ^$ around them.
  # NB: device-name is shorthand for 'match device-name'
-@@ -13,202 +10,12 @@
- 	# are returned from readdir(3).  The rule-sets are combined to
- 	# create a DFA that's used to match events to actions.
+@@ -13,7 +10,6 @@
+ 	# that they are returned from readdir(3).  The rule-sets are combined
+ 	# to create a DFA that's used to match events to actions.
  	directory "/etc/devd";
 -	directory "/usr/local/etc/devd";
  	pid-file "/var/run/devd.pid";
--
--	# Setup some shorthand for regex that we use later in the file.
--	#XXX Yes, these are gross -- imp
--	set scsi-controller-regex
--		"(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\
--		esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\
--		[0-9]+";
- };
  
+ 	# Setup some shorthand for regex that we use later in the file.
+@@ -27,54 +23,6 @@
  # Note that the attach/detach with the highest value wins, so that one can
  # override these general rules.
  
@@ -62,8 +56,8 @@
 -# script is called pccard_ether.
 -#
 -# NB: DETACH events are ignored; the kernel should handle all cleanup
--#     (routes, arp cache) if you need to do something beware of races
--#     against immediate create of a device w/ the same name; e.g.
+-#     (routes, arp cache).  Beware of races against immediate create
+-#     of a device with the same name; e.g.
 -#	ifconfig bridge0 destroy; ifconfig bridge0 create
 -#
 -notify 0 {
@@ -73,9 +67,9 @@
 -};
 -
 -#
--# Try to start dhclient on Ethernet like interfaces when the link comes
+-# Try to start dhclient on Ethernet-like interfaces when the link comes
 -# up.  Only devices that are configured to support DHCP will actually
--# run it.  No link down rule exists because dhclient automaticly exits
+-# run it.  No link down rule exists because dhclient automatically exits
 -# when the link goes down.
 -#
 -notify 0 {
@@ -105,20 +99,15 @@
 -	action "/etc/rc.d/dhclient quietstart $subsystem";
 -};
 -
--# An entry like this might be in a different file, but is included here
--# as an example of how to override things.  Normally 'ed50' would match
--# the above attach/detach stuff, but the value of 100 makes it
--# hard wired to 1.2.3.4.
+ # An entry like this might be in a different file, but is included here
+ # as an example of how to override things.  Normally 'ed50' would match
+ # the above attach/detach stuff, but the value of 100 makes it
+@@ -87,74 +35,6 @@
+ 	device-name "ed50";
+ };
+ 
+-# When a USB Bluetooth dongle appears, activate it
 -attach 100 {
--	device-name "ed50";
--	action "ifconfig $device-name inet 1.2.3.4 netmask 0xffff0000";
--};
--detach 100 {
--	device-name "ed50";
--};
--
--# When a USB Bluetooth dongle appears activate it
--attach 100 {
 -	device-name "ubt[0-9]+";
 -	action "/etc/rc.d/bluetooth quietstart $device-name";
 -};
@@ -155,7 +144,7 @@
 -};
 -
 -# Firmware download into the ActiveWire board. After the firmware download is
--# done the device detaches and reappears as something new and shiny
+-# done, the device detaches and reappears as something new and shiny
 -# automatically.
 -attach 100 {
 -	match "vendor"	"0x0854";
@@ -185,53 +174,13 @@
 -	action "/usr/local/bin/coldsync -md -p /dev/$cdev -t usb";
 -};
 -
--#
--# Rescan scsi device-names on attach, but not detach.  However, it is
--# disabled by default due to reports of problems.
--#
--attach 0 {
--	device-name "$scsi-controller-regex";
--//	action "camcontrol rescan all";
--};
--
--# Don't even try to second guess what to do about drivers that don't
--# match here.  Instead, pass it off to syslog.  Commented out for the
--# moment, as the pnpinfo variable isn't set in devd yet.  Individual
--# variables within the bus supplied pnpinfo are set.
--nomatch 0 {
--#	action "logger Unknown device: $pnpinfo $location $bus";
--};
--
--# Various logging of unknown devices.
--nomatch 10 {
--	match "bus" "uhub[0-9]+";
--	action "logger Unknown USB device: vendor $vendor product $product \
--		bus $bus";
--};
--
--# Some PC-CARDs don't offer numerical manufacturer/product IDs, just
--# show the CIS info there.
--nomatch 20 {
--	match "bus" "pccard[0-9]+";
--	match "manufacturer" "0xffffffff";
--	match "product" "0xffffffff";
--	action "logger Unknown PCCARD device: CISproduct $cisproduct \
--		CIS-vendor $cisvendor bus $bus";
--};
--
--nomatch 10 {
--	match "bus" "pccard[0-9]+";
--	action "logger Unknown PCCARD device: manufacturer $manufacturer \
--		product $product CISproduct $cisproduct CIS-vendor \
--		$cisvendor bus $bus";
--};
--
--nomatch 10 {
--	match "bus" "cardbus[0-9]+";
--	action "logger Unknown Cardbus device: device $device class $class \
--		vendor $vendor bus $bus";
--};
--
+ #
+ # Rescan scsi device-names on attach, but not detach.  However, it is
+ # disabled by default due to reports of problems.
+@@ -202,13 +82,6 @@
+ 		vendor $vendor bus $bus";
+ };
+ 
 -# Switch power profiles when the AC line state changes.
 -notify 10 {
 -	match "system"		"ACPI";
@@ -242,11 +191,10 @@
  # Notify all users before beginning emergency shutdown when we get
  # a _CRT or _HOT thermal event and we're going to power down the system
  # very soon.
-@@ -249,68 +56,3 @@
- 	match "type"		"checksum";
+@@ -250,19 +123,6 @@
  	action "logger -p kern.warn 'ZFS: checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'";
  };
--
+ 
 -# User requested suspend, so perform preparation steps and then execute
 -# the actual suspend process.
 -notify 10 {
@@ -260,54 +208,6 @@
 -	action "/etc/rc.resume acpi $notify";
 -};
 -
--/* EXAMPLES TO END OF FILE
--
--# The following might be an example of something that a vendor might
--# install if you were to add their device.  This might reside in
--# /usr/local/etc/devd/deqna.conf.  A deqna is, in this hypothetical
--# example, a pccard ethernet-like device.  Students of history may
--# know other devices by this name, and will get the in-jokes in this
--# entry.
--nomatch 10 {
--	match "bus" "pccard[0-9]+";
--	match "manufacturer" "0x1234";
--	match "product" "0x2323";
--	action "kldload if_deqna";
--};
--attach 10 {
--	device-name "deqna[0-9]+";
--	action "/etc/pccard_ether $device-name start";
--};
--detach 10 {
--	device-name "deqna[0-9]+";
--	action "/etc/pccard_ether $device-name stop";
--};
--
--# Examples of notify hooks.  A notify is a generic way for a kernel
--# subsystem to send event notification to userland.
--#
--# Here are some examples of ACPI notify handlers.  ACPI subsystems that
--# generate notifies include the AC adapter, power/sleep buttons,
--# control method batteries, lid switch, and thermal zones.
--#
--# Information returned is not always the same as the ACPI notify
--# events.  See the ACPI specification for more information about
--# notifies.  Here is the information returned for each subsystem:
--#
--# ACAD:		AC line state (0 is offline, 1 is online)
--# Button:	Button pressed (0 for power, 1 for sleep)
--# CMBAT:	ACPI battery events
--# Lid:		Lid state (0 is closed, 1 is open)
--# Suspend, Resume: Suspend and resume notification
--# Thermal:	ACPI thermal zone events
--#
--# This example calls a script when the AC state changes, passing the
--# notify value as the first argument.  If the state is 0x00, it might
--# call some sysctls to implement economy mode.  If 0x01, it might set
--# the mode to performance.
--notify 10 {
--	match "system"		"ACPI";
--	match "subsystem"	"ACAD";
--	action			"/etc/acpi_ac $notify";
--};
--*/
+ /* EXAMPLES TO END OF FILE
+ 
+ # An example of something that a vendor might install if you were to

Modified: trunk/freebsd-utils/debian/patches/024_devfs.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/024_devfs.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/024_devfs.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,10 +1,3 @@
----
- sbin/devfs/Makefile |    1 +
- sbin/devfs/devfs.c  |    2 +-
- sbin/devfs/extern.h |    2 +-
- sbin/devfs/rule.c   |   20 +++++++++++---------
- 4 files changed, 14 insertions(+), 11 deletions(-)
-
 --- a/sbin/devfs/extern.h
 +++ b/sbin/devfs/extern.h
 @@ -50,7 +50,7 @@
@@ -18,11 +11,11 @@
  
 --- a/sbin/devfs/Makefile
 +++ b/sbin/devfs/Makefile
-@@ -4,5 +4,6 @@
+@@ -3,5 +3,6 @@
+ PROG=	devfs
  SRCS=	devfs.c rule.c
  MAN=	devfs.8
- WARNS?=	5
-+LDADD=  -lbsd
++LDADD+= -lbsd
  
  .include <bsd.prog.mk>
 --- a/sbin/devfs/rule.c
@@ -38,69 +31,6 @@
  		switch (ch) {
  		case 's':
  			in_rsnum = eatonum(optarg);
-@@ -125,7 +125,7 @@
- }
- 
- static int
--rule_apply(int ac __attribute__((unused)), char **av __attribute__((unused)))
-+rule_apply(int ac, char **av)
- {
- 	struct devfs_rule dr;
- 	devfs_rnum rnum;
-@@ -153,7 +153,7 @@
- }
- 
- static int
--rule_applyset(int ac, char **av __attribute__((unused)))
-+rule_applyset(int ac, char **av)
- {
- 	int rv;
- 
-@@ -166,7 +166,7 @@
- }
- 
- static int
--rule_del(int ac __attribute__((unused)), char **av)
-+rule_del(int ac, char **av)
- {
- 	devfs_rid rid;
- 	int rv;
-@@ -181,7 +181,7 @@
- }
- 
- static int
--rule_delset(int ac, char **av __attribute__((unused)))
-+rule_delset(int ac, char **av)
- {
- 	struct devfs_rule dr;
- 	int rv;
-@@ -202,7 +202,7 @@
- }
- 
- static int
--rule_show(int ac __attribute__((unused)), char **av)
-+rule_show(int ac, char **av)
- {
- 	struct devfs_rule dr;
- 	devfs_rnum rnum;
-@@ -229,7 +229,7 @@
- }
- 
- static int
--rule_showsets(int ac, char **av __attribute__((unused)))
-+rule_showsets(int ac, char **av)
- {
- 	devfs_rsnum rsnum;
- 
-@@ -307,7 +307,7 @@
-  * Construct a /struct devfs_rule/ from ac and av.
-  */
- static void
--rulespec_intok(struct devfs_rule *dr, int ac __attribute__((unused)), char **av,
-+rulespec_intok(struct devfs_rule *dr, int ac, char **av,
-     devfs_rsnum rsnum)
- {
- 	struct intstr *is;
 --- a/sbin/devfs/devfs.c
 +++ b/sbin/devfs/devfs.c
 @@ -62,7 +62,7 @@

Modified: trunk/freebsd-utils/debian/patches/025_camcontrol.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/025_camcontrol.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/025_camcontrol.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,10 +1,3 @@
----
- sbin/camcontrol/Makefile     |    2 +-
- sbin/camcontrol/camcontrol.c |    9 ++++-----
- sbin/camcontrol/modeedit.c   |    6 +++---
- sbin/camcontrol/util.c       |    4 ++--
- 4 files changed, 10 insertions(+), 11 deletions(-)
-
 --- a/sbin/camcontrol/camcontrol.c
 +++ b/sbin/camcontrol/camcontrol.c
 @@ -30,7 +30,7 @@
@@ -15,21 +8,27 @@
 +#include <stdint.h>
  #include <sys/types.h>
  #include <sys/endian.h>
- 
-@@ -123,9 +123,9 @@
+ #include <sys/sbuf.h>
+@@ -132,12 +132,12 @@
  };
  
  #ifndef MINIMALISTIC
 -static const char scsicmd_opts[] = "a:c:dfi:o:r";
 -static const char readdefect_opts[] = "f:GP";
 -static const char negotiate_opts[] = "acD:M:O:qR:T:UW:";
+-static const char smprg_opts[] = "l";
+-static const char smppc_opts[] = "a:A:d:lm:M:o:p:s:S:T:";
+-static const char smpphylist_opts[] = "lq";
 +static const char scsicmd_opts[] = "+a:c:dfi:o:r";
 +static const char readdefect_opts[] = "+f:GP";
 +static const char negotiate_opts[] = "+acD:M:O:qR:T:UW:";
++static const char smprg_opts[] = "+l";
++static const char smppc_opts[] = "+a:A:d:lm:M:o:p:s:S:T:";
++static const char smpphylist_opts[] = "+lq";
  #endif
  
  struct camcontrol_opts option_table[] = {
-@@ -4709,7 +4709,6 @@
+@@ -6036,7 +6036,6 @@
  	 * the arguments again.
  	 */
  	optind = optstart;
@@ -37,35 +36,6 @@
  
  	switch(cmdlist) {
  #ifndef MINIMALISTIC
---- a/sbin/camcontrol/modeedit.c
-+++ b/sbin/camcontrol/modeedit.c
-@@ -140,7 +140,7 @@
- 
- 
- static void
--editentry_create(void *hook __attribute__((unused)), int letter, void *arg, int count,
-+editentry_create(void *hook, int letter, void *arg, int count,
- 		 char *name)
- {
- 	struct editentry *newentry;	/* Buffer to hold new entry. */
-@@ -162,7 +162,7 @@
- }
- 
- static void
--editentry_update(void *hook __attribute__((unused)), int letter, void *arg, int count,
-+editentry_update(void *hook, int letter, void *arg, int count,
- 		 char *name)
- {
- 	struct editentry *dest;		/* Buffer to hold entry to update. */
-@@ -190,7 +190,7 @@
- }
- 
- static int
--editentry_save(void *hook __attribute__((unused)), char *name)
-+editentry_save(void *hook, char *name)
- {
- 	struct editentry *src;		/* Entry value to save. */
- 
 --- a/sbin/camcontrol/util.c
 +++ b/sbin/camcontrol/util.c
 @@ -46,7 +46,7 @@
@@ -77,19 +47,10 @@
  #include <sys/types.h>
  
  #include <stdlib.h>
-@@ -107,7 +107,7 @@
- /* arg_put: "put argument" callback
-  */
- void
--arg_put(void *hook __attribute__((unused)), int letter, void *arg, int count, char *name)
-+arg_put(void *hook, int letter, void *arg, int count, char *name)
- {
- 	if (verbose && name && *name)
- 		printf("%s:  ", name);
 --- a/sbin/camcontrol/Makefile
 +++ b/sbin/camcontrol/Makefile
-@@ -13,7 +13,7 @@
- WARNS?=	6
+@@ -12,7 +12,7 @@
+ WARNS?= 3
  .endif
  DPADD=	${LIBCAM} ${LIBSBUF} ${LIBUTIL}
 -LDADD=	-lcam -lsbuf -lutil

Modified: trunk/freebsd-utils/debian/patches/026_kdump.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/026_kdump.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/026_kdump.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -7,31 +7,15 @@
 
 --- a/usr.bin/kdump/kdump.c
 +++ b/usr.bin/kdump/kdump.c
-@@ -45,20 +45,18 @@
- #include <sys/cdefs.h>
- __FBSDID("$FreeBSD$");
- 
--#define _KERNEL
--extern int errno;
- #include <sys/errno.h>
--#undef _KERNEL
-+#define ERESTART        (-1)            /* restart syscall */
-+#define EJUSTRETURN     (-2)            /* don't modify regs, just return */
- #include <sys/param.h>
- #include <sys/errno.h>
--#define _KERNEL
- #include <sys/time.h>
--#undef _KERNEL
- #include <sys/uio.h>
- #include <sys/ktrace.h>
+@@ -55,6 +55,7 @@
  #include <sys/ioctl.h>
  #include <sys/socket.h>
  #include <sys/stat.h>
 +#include "stat16.h"
+ #include <sys/sysent.h>
  #include <sys/un.h>
- #ifdef IPX
- #include <sys/types.h>
-@@ -71,6 +69,8 @@
+ #include <sys/queue.h>
+@@ -69,6 +70,8 @@
  #include <netinet/in.h>
  #include <ctype.h>
  #include <dlfcn.h>
@@ -40,7 +24,7 @@
  #include <err.h>
  #include <grp.h>
  #include <inttypes.h>
-@@ -97,7 +97,7 @@
+@@ -97,7 +100,7 @@
  void ktrcsw(struct ktr_csw *);
  void ktruser(int, unsigned char *);
  void ktrsockaddr(struct sockaddr *);
@@ -49,17 +33,17 @@
  void ktrstruct(char *, size_t);
  void usage(void);
  void sockfamilyname(int);
-@@ -111,6 +111,9 @@
- #define TIME_FORMAT	"%b %e %T %Y"
- #define eqs(s1, s2)	(strcmp((s1), (s2)) == 0)
+@@ -155,6 +158,9 @@
  
+ TAILQ_HEAD(trace_procs, proc_info) trace_procs;
+ 
 +timevaladd(struct timeval *t1, const struct timeval *t2);
 +timevalsub(struct timeval *t1, const struct timeval *t2);
 +
  int
  main(int argc, char *argv[])
  {
-@@ -653,7 +656,7 @@
+@@ -788,7 +794,7 @@
  				ip++;
  				narg--;
  				c = ',';
@@ -68,38 +52,7 @@
  				print_number(ip,narg,c);
  				print_number(ip,narg,c);
  				(void)putchar(',');
-@@ -745,18 +748,18 @@
- 				ip++;
- 				narg--;
- 				c = ',';
--			} else if (ktr->ktr_code == SYS___acl_get_file ||
--				   ktr->ktr_code == SYS___acl_set_file ||
--				   ktr->ktr_code == SYS___acl_get_fd ||
--				   ktr->ktr_code == SYS___acl_set_fd ||
--				   ktr->ktr_code == SYS___acl_delete_file ||
--				   ktr->ktr_code == SYS___acl_delete_fd ||
--				   ktr->ktr_code == SYS___acl_aclcheck_file ||
--				   ktr->ktr_code == SYS___acl_aclcheck_fd ||
--				   ktr->ktr_code == SYS___acl_get_link ||
--				   ktr->ktr_code == SYS___acl_set_link ||
--				   ktr->ktr_code == SYS___acl_delete_link ||
--				   ktr->ktr_code == SYS___acl_aclcheck_link) {
-+			} else if (ktr->ktr_code == SYS_acl_get_file ||
-+				   ktr->ktr_code == SYS_acl_set_file ||
-+				   ktr->ktr_code == SYS_acl_get_fd ||
-+				   ktr->ktr_code == SYS_acl_set_fd ||
-+				   ktr->ktr_code == SYS_acl_delete_file ||
-+				   ktr->ktr_code == SYS_acl_delete_fd ||
-+				   ktr->ktr_code == SYS_acl_aclcheck_file ||
-+				   ktr->ktr_code == SYS_acl_aclcheck_fd ||
-+				   ktr->ktr_code == SYS_acl_get_link ||
-+				   ktr->ktr_code == SYS_acl_set_link ||
-+				   ktr->ktr_code == SYS_acl_delete_link ||
-+				   ktr->ktr_code == SYS_acl_aclcheck_link) {
- 				print_number(ip,narg,c);
- 				(void)putchar(',');
- 				acltypename((int)*ip);
-@@ -1246,7 +1249,7 @@
+@@ -1379,7 +1385,7 @@
  }
  
  void
@@ -108,37 +61,49 @@
  {
  	char mode[12], timestr[PATH_MAX + 4];
  	struct passwd *pwd;
-@@ -1351,7 +1354,7 @@
- 	if (strcmp(name, "stat") == 0) {
- 		if (datalen != sizeof(struct stat))
- 			goto invalid;
--		ktrstat((struct stat *)data);
-+		ktrstat((struct stat16 *)data);
- 	} else if (strcmp(name, "sockaddr") == 0) {
- 		if (datalen < sizeof(struct sockaddr) ||
- 		    datalen != ((struct sockaddr *)(data))->sa_len)
 --- a/usr.bin/kdump/Makefile
 +++ b/usr.bin/kdump/Makefile
-@@ -6,13 +6,14 @@
+@@ -10,6 +10,7 @@
  PROG=		kdump
  SRCS=		kdump.c ioctl.c kdump_subr.c subr.c
  CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../..
 +LDADD+=		-lbsd
  
- CLEANFILES=	ioctl.c kdump_subr.c
+ .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+ SRCS+=		linux_syscalls.c
+@@ -20,10 +21,10 @@
+ CLEANFILES=	ioctl.c kdump_subr.c linux_syscalls.c
  
  ioctl.c: mkioctls
 -	sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
-+	sh ${.CURDIR}/mkioctls /usr/include > ${.TARGET}
++	sh ${.CURDIR}/mkioctls /usr/include /usr/include/*-kfreebsd-gnu > ${.TARGET}
  
  kdump_subr.c: mksubr
 -	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET}
-+	sh ${.CURDIR}/mksubr /usr/include > ${.TARGET}
++	sh ${.CURDIR}/mksubr /usr/include /usr/include/*-kfreebsd-gnu > ${.TARGET}
  
- .include <bsd.prog.mk>
+ linux_syscalls.c:
+ 	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
 --- a/usr.bin/kdump/mksubr
 +++ b/usr.bin/kdump/mksubr
-@@ -56,7 +56,9 @@
+@@ -50,7 +50,7 @@
+ 	echo "usage: sh $0 include-dir"
+ 	exit 1
+ fi
+-include_dir=$1
++include_dirs="$*"
+ 
+ #
+ # Automatically generates a C function that will print out the
+@@ -74,13 +74,16 @@
+ 	int	or = 0;
+ 	printf("%#x<", arg);
+ _EOF_
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
+ 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
+-		$include_dir/$file | \
++		$include_dir/$file ; fi ; done | \
+ 	awk '{ for (i = 1; i <= NF; i++) \
  		if ($i ~ /define/) \
  			break; \
  		++i; \
@@ -147,9 +112,31 @@
 +		sub("__", "", n); \
 +		printf "\tif(!((arg>0)^((%s)>0)))\n\t\tif_print_or(arg, %s, or);\n", $i, n }'
  cat <<_EOF_
+ 	printf(">");
  	if (or == 0)
- 		(void)printf("<invalid>%ld", (long)arg);
-@@ -135,6 +137,7 @@
+@@ -107,8 +110,9 @@
+ {
+ 	switch (arg) {
+ _EOF_
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
+ 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
+-		$include_dir/$file | \
++		$include_dir/$file ; fi ; done | \
+ 	awk '{ for (i = 1; i <= NF; i++) \
+ 		if ($i ~ /define/) \
+ 			break; \
+@@ -139,8 +143,9 @@
+ $name (int arg)
+ {
+ _EOF_
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
+ 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
+-		$include_dir/$file | \
++		$include_dir/$file ; fi ; done | \
+ 	awk '{ printf "\t"; \
+ 		if (NR > 1) \
+ 			printf "else " ; \
+@@ -160,6 +165,7 @@
  #include <sys/fcntl.h>
  #include <sys/stat.h>
  #include <sys/unistd.h>
@@ -157,7 +144,7 @@
  #include <sys/mman.h>
  #include <sys/wait.h>
  #define _KERNEL
-@@ -148,21 +151,30 @@
+@@ -173,21 +179,30 @@
  #include <sys/reboot.h>
  #include <sched.h>
  #include <sys/linker.h>
@@ -193,38 +180,8 @@
  /*
   * These are simple support macros. print_or utilizes a variable
   * defined in the calling function to track whether or not it should
-@@ -304,45 +316,72 @@
- 	}
- }
+@@ -331,43 +346,43 @@
  
-+/*
-+ * MANUAL
-+ */
-+
-+void
-+acltypename (int arg)
-+{
-+	switch (arg) {
-+	case 0x00000000:
-+		(void)printf("ACL_TYPE_ACCESS_OLD");
-+		break;
-+	case 0x00000001:
-+		(void)printf("ACL_TYPE_ACCESS_OLD");
-+		break;
-+	case 0x00000002:
-+		(void)printf("ACL_TYPE_ACCESS");
-+		break;
-+	case 0x00000003:
-+		(void)printf("ACL_TYPE_DEFAULT");
-+		break;
-+	case 0x00000004:
-+		(void)printf("ACL_TYPE_NFS4");
-+	 	break;
-+	default: /* Should not reach */
-+		(void)printf("<invalid=%ld>", (long)arg);
-+	}
-+}
-+
  _EOF_
  
 -auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
@@ -234,8 +191,8 @@
 -auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
 -auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
 +auto_or_type "modename" "__S_[A-Z]+[[:space:]]+[0-6]{7}" "bits/stat.h"
-+auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+[0-9]+" "bits/fcntl.h"
-+auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+[0-9]+" "fcntl.h"
++auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "bits/fcntl.h"
++auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "fcntl.h"
 +auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "bits/mman.h"
 +auto_or_type "mmapflagsname" "MAP_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "bits/mman.h"
 +auto_or_type "wait4optname" "W[A-Z]+[[:space:]]+[0-9]+" "bits/waitflags.h"
@@ -243,34 +200,32 @@
  auto_or_type "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h"
  auto_or_type "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
 -auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
-+auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+[0-9]+" "bits/fcntl.h"
++auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "bits/fcntl.h"
  auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h"
 -auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
 -auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
 -auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
-+auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+[0-9]+" "bits/mman.h"
++auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "bits/mman.h"
 +auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "bits/shm.h"
 +auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/rfork.h"
  auto_or_type "nfssvcname" "NFSSVC_[A-Z]+[[:space:]]+0x[0-9]+" "nfsserver/nfs.h"
  
 -auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
--auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
--auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
++auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "stdio.h"
+ auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
+ auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
 -auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h"
 -auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
 -auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
-+auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "stdio.h"
-+auto_switch_type "rlimitname" "RLIMIT_[A-Z]++[[:space:]]+" "bits/resource.h"
-+auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+" "sys/socket.h"
-+auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+" "bits/resource.h"
++auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "bits/resource.h"
 +auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "bits/mman.h"
-+auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+[0-9]+" "bits/mman.h"
++auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "bits/mman.h"
  auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h"
  auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
  auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h"
  auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
  auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
--auto_switch_type "acltypename" "ACL_TYPE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/acl.h"
+ auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"
 -auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
 -auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
 -auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
@@ -286,25 +241,40 @@
 -auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
 -auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"
 +auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "bits/socket.h"
-+auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+" "bits/socket.h"
- auto_switch_type "ptraceopname" "PT_[[:alnum:]]+[[:space:]]+[0-9]+" "sys/ptrace.h"
++auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "bits/socket.h"
+ auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h"
  
  cat <<_EOF_
-@@ -405,7 +444,7 @@
+@@ -381,8 +396,9 @@
  {
+ 	switch (cmd) {
+ _EOF_
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
+ egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \
+-	$include_dir/sys/fcntl.h | \
++	$include_dir/sys/fcntl.h ; fi ; done | \
+ 	awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \
+ 		if ($i ~ /define/) \
+ 			break; \
+@@ -430,8 +446,9 @@
+ {
  	switch (func) {
  _EOF_
 -egrep "^#[[:space:]]*define[[:space:]]+RTP_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" \
+-	$include_dir/sys/rtprio.h | grep -v RTP_PRIO | \
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
 +egrep "^#[[:space:]]*define[[:space:]]+RTP_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \
- 	$include_dir/sys/rtprio.h | grep -v RTP_PRIO | \
++	$include_dir/sys/rtprio.h ; fi ; done | grep -v RTP_PRIO | \
  	awk '{ for (i = 1; i <= NF; i++) \
  		if ($i ~ /define/) \
-@@ -435,7 +474,7 @@
- 		return;
- 	}
+ 			break; \
+@@ -462,7 +479,8 @@
+ 
+ 	printf("%#x<", flags);
  _EOF_
 -egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \
-+egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]*" $include_dir/bits/socket.h | \
++	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
++egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]*" $include_dir/bits/socket.h ; fi ; done | \
  	awk '{ for (i = 1; i <= NF; i++) \
  		if ($i ~ /define/) \
  			break; \
@@ -345,9 +315,9 @@
 +
 +    __dev_t st_rdev;		/* Device number, if device.  */
 +
-+    struct  timespec st_atimespec;  /* time of last access */
-+    struct  timespec st_mtimespec;  /* time of last data modification */
-+    struct  timespec st_ctimespec;  /* time of last file status change */
++    struct  timespec st_atim;  /* time of last access */
++    struct  timespec st_mtim;  /* time of last data modification */
++    struct  timespec st_ctim;  /* time of last file status change */
 +
 +    __off_t st_size;		/* Size of file, in bytes.  */
 +
@@ -361,8 +331,37 @@
 +
 +    __uint32_t __dummy1;
 +
-+    struct timespec st_birthtimespec; /* time of file creation */
++    struct timespec st_birthtim; /* time of file creation */
 +
 +#define _BIRTH_PADSIZE     (2*(8 - sizeof (long)))
 +    char __birth_padding[_BIRTH_PADSIZE];
 +  };
+--- a/usr.bin/kdump/mkioctls
++++ b/usr.bin/kdump/mkioctls
+@@ -15,21 +15,23 @@
+ 	echo "usage: sh $0 [-s] include-dir"
+ 	exit 1
+ fi
++include_dirs="$*"
+ 
+ LC_ALL=C; export LC_ALL
+ 
+ # Build a list of headers that have ioctls in them.
+ # XXX should we use an ANSI cpp?
+ ioctl_includes=`
+-	cd $1
+-	find -H -s * -name '*.h' |
++	for include_dir in $include_dirs ; do \
++	cd $include_dir
++	find -H -s * -name '*.h' ; done |
+ 		xargs egrep -l \
+ '^#[ 	]*define[ 	]+[A-Za-z_][A-Za-z0-9_]*[ 	]+_IO[^a-z0-9_]' |
+ 		awk '{printf("#include <%s>\\\\n", $1)}'
+ `
+ 
+ awk -v x="$ioctl_includes" 'BEGIN {print x}' |
+-	gcc -E -I$1 -dM -DCOMPAT_43TTY - |
++	gcc -E -dM -DCOMPAT_43TTY - |
+ 	awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
+ BEGIN {
+ 	print "/* XXX obnoxious prerequisites. */"

Modified: trunk/freebsd-utils/debian/patches/027_pppctl.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/027_pppctl.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/027_pppctl.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -5,8 +5,8 @@
 
 --- a/usr.sbin/pppctl/Makefile
 +++ b/usr.sbin/pppctl/Makefile
-@@ -4,6 +4,6 @@
- MAN=	pppctl.8
+@@ -6,6 +6,6 @@
+ WARNS?=	2
  
  DPADD=	${LIBPTHREAD} ${LIBEDIT} ${LIBTERMCAP}
 -LDADD=	-lpthread -ledit -ltermcap

Modified: trunk/freebsd-utils/debian/patches/028_vidcontrol.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/028_vidcontrol.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/028_vidcontrol.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -5,11 +5,10 @@
 
 --- a/usr.sbin/vidcontrol/Makefile
 +++ b/usr.sbin/vidcontrol/Makefile
-@@ -2,6 +2,7 @@
+@@ -2,5 +2,6 @@
  
  PROG=	vidcontrol
  SRCS=	vidcontrol.c decode.c
 +LDADD += -lbsd
  
- WARNS?=	6
- 
+ .include <bsd.prog.mk>

Modified: trunk/freebsd-utils/debian/patches/029_arp.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/029_arp.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/029_arp.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,7 +1,3 @@
----
- usr.sbin/arp/arp.c |    7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
 --- a/usr.sbin/arp/arp.c
 +++ b/usr.sbin/arp/arp.c
 @@ -65,6 +65,7 @@
@@ -12,14 +8,13 @@
  
  #include <arpa/inet.h>
  
-@@ -656,8 +657,8 @@
-  * Nuke an arp entry
-  */
- static void
--nuke_entry(struct sockaddr_dl *sdl __attribute__((unused)),
--	struct sockaddr_inarp *addr, struct rt_msghdr *rtm __attribute__((unused)))
-+nuke_entry(struct sockaddr_dl *sdl,
-+	struct sockaddr_inarp *addr, struct rt_msghdr *rtm)
- {
- 	char ip[20];
+--- a/usr.sbin/arp/Makefile
++++ b/usr.sbin/arp/Makefile
+@@ -3,6 +3,7 @@
  
+ PROG=	arp
+ MAN=	arp.4 arp.8
++LDADD+= -lrt
+ 
+ WARNS?=	3
+ 

Modified: trunk/freebsd-utils/debian/patches/031_savecore.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/031_savecore.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/031_savecore.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -10,9 +10,9 @@
  
  PROG=	savecore
 +SRCS=	savecore.c zopen.c
- WARNS?=	6
  DPADD=	${LIBZ}
  LDADD=	-lz
+ MAN=	savecore.8
 --- /dev/null
 +++ b/sbin/savecore/zopen.c
 @@ -0,0 +1,42 @@

Modified: trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/032_libbsd_overlay.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -96,9 +96,9 @@
  #include <sys/cdefs.h>
  __FBSDID("$FreeBSD$");
  
-@@ -39,7 +40,6 @@
- //#include <login_cap.h>
+@@ -41,7 +42,6 @@
  #include <pwd.h>
+ #include <grp.h>
  #include <signal.h>
 -#include <stdio.h>
  #include <stdlib.h>

Modified: trunk/freebsd-utils/debian/patches/035_nfs.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/035_nfs.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/035_nfs.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -16,7 +16,7 @@
  	char *name, *p, *spec, *fstype;
  	char mntpath[MAXPATHLEN], errmsg[255];
  	char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50];
-@@ -421,25 +419,14 @@
+@@ -417,25 +415,14 @@
  	build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
  	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
  
@@ -44,7 +44,7 @@
  static int
  findopt(struct iovec *iov, int iovlen, const char *name,
      char **valuep, int *lenp)
-@@ -661,16 +648,23 @@
+@@ -657,16 +644,23 @@
  
  	return nmount(newiov, newiovlen, mntflags);
  }
@@ -68,7 +68,7 @@
  	if (!strcmp(sec, "sys"))
  		return (AUTH_SYS);
  	return (-1);
-@@ -680,12 +674,18 @@
+@@ -676,12 +670,18 @@
  sec_num_to_name(int flavor)
  {
  	switch (flavor) {
@@ -87,7 +87,7 @@
  	case AUTH_SYS:
  		return ("sys");
  	}
-@@ -830,9 +830,11 @@
+@@ -826,9 +826,11 @@
  	freeaddrinfo(ai_nfs);
  
  	build_iovec(iov, iovlen, "hostname", nam, (size_t)-1);
@@ -107,7 +107,7 @@
  SRCS=	mount_nfs.c getmntopts.c mounttab.c
 +LDADD=	-ltirpc
  MAN=	mount_nfs.8
- MLINKS=	mount_nfs.8 mount_newnfs.8
+ MLINKS=	mount_nfs.8 mount_oldnfs.8
  
 --- a/usr.sbin/mountd/Makefile
 +++ b/usr.sbin/mountd/Makefile
@@ -128,7 +128,7 @@
  .include <bsd.prog.mk>
 --- a/usr.sbin/mountd/mountd.c
 +++ b/usr.sbin/mountd/mountd.c
-@@ -1926,12 +1926,18 @@
+@@ -2066,12 +2066,18 @@
  
  		if (!strcmp(seclist, "sys"))
  			flavor = AUTH_SYS;
@@ -149,70 +149,32 @@
  				*cp = savedc;
 --- a/usr.sbin/nfsd/Makefile
 +++ b/usr.sbin/nfsd/Makefile
-@@ -3,6 +3,8 @@
+@@ -3,5 +3,7 @@
  
  PROG=	nfsd
  MAN=	nfsd.8 nfsv4.4 stablerestart.5
 +CFLAGS+= -I${.CURDIR}/../../sys
 +LDADD=   -ltirpc -lbsd
  
- WARNS?=	6
- 
---- a/usr.sbin/nfsd/nfsd.c
-+++ b/usr.sbin/nfsd/nfsd.c
-@@ -849,13 +849,13 @@
- }
- 
- void
--nonfs(__attribute__((unused)) int signo)
-+nonfs(int signo)
- {
- 	syslog(LOG_ERR, "missing system call: NFS not available");
- }
- 
- void
--reapchild(__attribute__((unused)) int signo)
-+reapchild(int signo)
- {
- 	pid_t pid;
- 	int i;
-@@ -890,7 +890,7 @@
-  * Cleanup master after SIGUSR1.
-  */
- void
--cleanup(__attribute__((unused)) int signo)
-+cleanup(int signo)
- {
- 	nfsd_exit(0);
- }
-@@ -899,7 +899,7 @@
-  * Cleanup child after SIGUSR1.
-  */
- void
--child_cleanup(__attribute__((unused)) int signo)
-+child_cleanup(int signo)
- {
- 	exit(0);
- }
+ .include <bsd.prog.mk>
 --- a/usr.sbin/rpc.lockd/Makefile
 +++ b/usr.sbin/rpc.lockd/Makefile
-@@ -4,24 +4,26 @@
- PROG=	rpc.lockd
+@@ -5,23 +5,27 @@
  MAN=	rpc.lockd.8
  MLINKS=	rpc.lockd.8 lockd.8
--SRCS=	kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
-+SRCS=	kern.c nlm_prot_svc.c nlm_prot_xdr.c lockd.c lock_proc.c lockd_lock.c sm_inter_xdr.c
+ SRCS=	kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
++SRCS+=	nlm_prot_xdr.c sm_inter_xdr.c
  
 -CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc
 +CFLAGS+= -I. -I${.CURDIR}/../../include/rpcsvc
- #WARNS?= 2
+ WARNS?= 3
  
  DPADD=	${LIBRPCSVC} ${LIBUTIL}
 -LDADD=	-lrpcsvc -lutil
 +LDADD=	-ltirpc -lbsd
  
--CLEANFILES= nlm_prot_svc.c nlm_prot.h test
-+CLEANFILES= nlm_prot_svc.c nlm_prot_xdr.c nlm_prot.h test
+ CLEANFILES= nlm_prot_svc.c nlm_prot.h test
++CLEANFILES+= nlm_prot_xdr.c
  
 -RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x
 +RPCSRC= ${.CURDIR}/../../include/rpcsvc/nlm_prot.x
@@ -232,7 +194,7 @@
  	cc -o test ${.CURDIR}/test.c -lrpcsvc
 --- a/usr.sbin/rpc.lockd/lockd.c
 +++ b/usr.sbin/rpc.lockd/lockd.c
-@@ -187,8 +187,7 @@
+@@ -198,8 +198,7 @@
  		kernel_lockd = TRUE;
  	}
  	if (kernel_lockd) {
@@ -242,7 +204,7 @@
  	}
  
  	(void)rpcb_unset(NLM_PROG, NLM_SM, NULL);
-@@ -807,7 +806,7 @@
+@@ -997,7 +996,7 @@
  		ret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON_ALL,
  		    (xdrproc_t)xdr_my_id, &id, (xdrproc_t)xdr_sm_stat, &stat);
  		if (ret == RPC_PROGUNAVAIL) {
@@ -251,7 +213,7 @@
  			    clnt_sperrno(ret));
  			sleep(2);
  			continue;
-@@ -816,7 +815,7 @@
+@@ -1006,7 +1005,7 @@
  	} while (0);
  
  	if (ret != 0) {
@@ -260,120 +222,6 @@
  		exit(1);
  	}
  
---- a/usr.sbin/rpc.lockd/lock_proc.c
-+++ b/usr.sbin/rpc.lockd/lock_proc.c
-@@ -770,7 +770,7 @@
-  */
- void *
- nlm_cancel_res_1_svc(arg, rqstp)
--	nlm_res *arg __attribute__((unused));
-+	nlm_res *arg;
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -803,7 +803,7 @@
-  */
- void *
- nlm_granted_res_1_svc(arg, rqstp)
--	nlm_res *arg __attribute__((unused));
-+	nlm_res *arg;
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -902,7 +902,7 @@
-  */
- void *
- nlm_free_all_3_svc(arg, rqstp)
--	nlm_notify *arg __attribute__((unused));
-+	nlm_notify *arg;
- 	struct svc_req *rqstp;
- {
- 	static char dummy;
-@@ -1260,7 +1260,7 @@
-  */
- void *
- nlm4_cancel_res_4_svc(arg, rqstp)
--	nlm4_res *arg __attribute__((unused));
-+	nlm4_res *arg;
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1275,7 +1275,7 @@
-  */
- void *
- nlm4_unlock_res_4_svc(arg, rqstp)
--	nlm4_res *arg __attribute__((unused));
-+	nlm4_res *arg;
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1290,7 +1290,7 @@
-  */
- void *
- nlm4_granted_res_4_svc(arg, rqstp)
--	nlm4_res *arg __attribute__((unused));
-+	nlm4_res *arg;
- 	struct svc_req *rqstp;
- {
- 	if (debug_level)
-@@ -1389,7 +1389,7 @@
-  */
- void *
- nlm4_free_all_4_svc(arg, rqstp)
--	struct nlm4_notify *arg __attribute__((unused));
-+	struct nlm4_notify *arg;
- 	struct svc_req *rqstp;
- {
- 	static char dummy;
-@@ -1407,7 +1407,7 @@
- void *
- nlm_sm_notify_0_svc(arg, rqstp)
- 	struct nlm_sm_status *arg;
--	struct svc_req *rqstp __attribute__((unused));
-+	struct svc_req *rqstp;
- {
- 	static char dummy;
- 	notify(arg->mon_name, arg->state);
---- a/usr.sbin/rpc.lockd/lockd_lock.c
-+++ b/usr.sbin/rpc.lockd/lockd_lock.c
-@@ -1176,8 +1176,8 @@
- 
- enum hwlock_status
- test_hwlock(fl, conflicting_fl)
--	const struct file_lock *fl __attribute__((unused));
--	struct file_lock **conflicting_fl __attribute__((unused));
-+	const struct file_lock *fl;
-+	struct file_lock **conflicting_fl;
- {
- 
- 	/*
-@@ -1891,7 +1891,7 @@
-  */
- 
- struct nlm4_holder *
--testlock(struct nlm4_lock *lock, bool_t exclusive, int flags __attribute__((unused)))
-+testlock(struct nlm4_lock *lock, bool_t exclusive, int flags)
- {
- 	struct file_lock test_fl, *conflicting_fl;
- 
-@@ -1991,7 +1991,7 @@
- 
- /* unlock a filehandle */
- enum nlm_stats
--unlock(nlm4_lock *lock, const int flags __attribute__((unused)))
-+unlock(nlm4_lock *lock, const int flags)
- {
- 	struct file_lock fl;
- 	enum nlm_stats err;
-@@ -2187,7 +2187,7 @@
- void
- send_granted(fl, opcode)
- 	struct file_lock *fl;
--	int opcode __attribute__((unused));
-+	int opcode;
- {
- 	CLIENT *cli;
- 	static char dummy;
 --- a/usr.sbin/rpc.lockd/kern.c
 +++ b/usr.sbin/rpc.lockd/kern.c
 @@ -51,8 +51,9 @@
@@ -387,105 +235,26 @@
  #include <nfs/nfsproto.h>
  #include <nfs/nfs_lock.h>
  
---- a/usr.sbin/rpc.statd/Makefile
-+++ b/usr.sbin/rpc.statd/Makefile
-@@ -2,22 +2,25 @@
- 
- PROG=	rpc.statd
- MAN=	rpc.statd.8
--SRCS=	file.c sm_inter_svc.c sm_inter.h statd.c procs.c
-+SRCS=	file.c sm_inter_svc.c sm_inter_xdr.c sm_inter.h statd.c procs.c
- 
- CFLAGS+= -I.
- #WARNS?= 2
- 
- DPADD=	${LIBRPCSVC}
--LDADD=	-lrpcsvc
-+LDADD=	-ltirpc -lbsd
- 
--CLEANFILES= sm_inter_svc.c sm_inter.h
-+CLEANFILES= sm_inter_svc.c sm_inter_xdr.c sm_inter.h
- 
--RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x
-+RPCSRC= ${.CURDIR}/../../include/rpcsvc/sm_inter.x
- RPCGEN= rpcgen -L -C
- 
- sm_inter_svc.c: ${RPCSRC}
- 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
- 
-+sm_inter_xdr.c: ${RPCSRC}
-+	${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
-+
- sm_inter.h: ${RPCSRC}
- 	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
- 
---- a/usr.sbin/rpc.statd/procs.c
-+++ b/usr.sbin/rpc.statd/procs.c
-@@ -257,7 +257,7 @@
- 		earlier call to sm_mon_1
- */
- 
--struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req __attribute__((unused)))
-+struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req)
- {
-   static sm_stat res;
-   HostInfo *hp;
-@@ -295,7 +295,7 @@
- 		host and program number.
- */
- 
--struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req __attribute__((unused)))
-+struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req)
- {
-   static sm_stat res;
-   HostInfo *hp;
-@@ -332,7 +332,7 @@
- 		and inform all hosts on the monitor list.
- */
- 
--void *sm_simu_crash_1_svc(void *v __attribute__((unused)), struct svc_req *req __attribute__((unused)))
-+void *sm_simu_crash_1_svc(void *v, struct svc_req *req)
- {
-   static char dummy;
-   int work_to_do;
-@@ -377,7 +377,7 @@
- 		that modify the list.
- */
- 
--void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req __attribute__((unused)))
-+void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req)
- {
-   struct timeval timeout = { 20, 0 };	/* 20 secs timeout		*/
-   CLIENT *cli;
 --- a/usr.sbin/rpc.statd/statd.c
 +++ b/usr.sbin/rpc.statd/statd.c
-@@ -55,6 +55,8 @@
- #include <unistd.h>
- #include "statd.h"
+@@ -58,6 +58,8 @@
  
+ #define	GETPORT_MAXTRY	20	/* Max tries to get a port # */
+ 
 +extern void sm_prog_1(struct svc_req *rqstp, register SVCXPRT *transp);
 +
  int debug = 0;		/* Controls syslog() calls for debug messages	*/
  
  char **hosts, *svcport_str = NULL;
-@@ -189,7 +191,7 @@
- 	  }
+@@ -281,7 +283,7 @@
+   	free(port_list);
    }
-   endnetconfig(nc_handle);
+ 
 -  init_file("/var/db/statd.status");
 +  init_file("/var/lib/misc/statd.status");
  
    /* Note that it is NOT sensible to run this program from inetd - the 	*/
    /* protocol assumes that it will run immediately at boot time.	*/
-@@ -446,7 +448,7 @@
- 		children to exit when they have done their work.
- */
- 
--static void handle_sigchld(int sig __attribute__((unused)))
-+static void handle_sigchld(int sig)
- {
-   int pid, status;
-   pid = wait4(-1, &status, WNOHANG, (struct rusage*)0);
 --- a/usr.sbin/rpc.statd/rpc.statd.8
 +++ b/usr.sbin/rpc.statd/rpc.statd.8
 @@ -110,7 +110,7 @@
@@ -497,3 +266,34 @@
  non-volatile record of currently monitored hosts.
  .It Pa /usr/include/rpcsvc/sm_inter.x
  RPC protocol specification used by local applications to register monitoring requests.
+--- a/usr.sbin/rpc.statd/Makefile
++++ b/usr.sbin/rpc.statd/Makefile
+@@ -3,21 +3,26 @@
+ PROG=	rpc.statd
+ MAN=	rpc.statd.8
+ SRCS=	file.c sm_inter_svc.c sm_inter.h statd.c procs.c
++SRCS+=	sm_inter_xdr.c
+ 
+ CFLAGS+= -I.
+ WARNS?= 2
+ 
+ DPADD=	${LIBRPCSVC}
+-LDADD=	-lrpcsvc
++LDADD=	-ltirpc -lbsd
+ 
+ CLEANFILES= sm_inter_svc.c sm_inter.h
++CLEANFILES+= sm_inter_xdr.c
+ 
+-RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x
++RPCSRC= ${.CURDIR}/../../include/rpcsvc/sm_inter.x
+ RPCGEN= rpcgen -L -C
+ 
+ sm_inter_svc.c: ${RPCSRC}
+ 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
+ 
++sm_inter_xdr.c: ${RPCSRC}
++	${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
++
+ sm_inter.h: ${RPCSRC}
+ 	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
+ 

Modified: trunk/freebsd-utils/debian/patches/036_nfs_glibc.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/036_nfs_glibc.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/036_nfs_glibc.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,148 +1,14 @@
-
-This stuff could be moved to glibc (or some other library).  See #629556 and #630843.
-
---- a/sbin/nfsiod/Makefile
-+++ b/sbin/nfsiod/Makefile
-@@ -2,7 +2,10 @@
- # $FreeBSD$
- 
- PROG=	nfsiod
-+SRCS=	nfsiod.c getvfsbyname.c
- WARNS?=	6
- MAN=	nfsiod.8
- 
-+.PATH: ${.CURDIR}/../../extra
-+
- .include <bsd.prog.mk>
---- /dev/null
-+++ b/extra/getvfsbyname.c
-@@ -0,0 +1,70 @@
-+/*
-+ * Copyright (c) 1995
-+ *	The Regents of the University of California.  All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ *    notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ *    notice, this list of conditions and the following disclaimer in the
-+ *    documentation and/or other materials provided with the distribution.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ *    may be used to endorse or promote products derived from this software
-+ *    without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#include <stddef.h>
-+#include <sys/mount.h>
-+#include <sys/sysctl.h>
-+#include <errno.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+/*
-+ * Given a filesystem name, determine if it is resident in the kernel,
-+ * and if it is resident, return its xvfsconf structure.
-+ */
-+int
-+getvfsbyname(fsname, vfcp)
-+	const char *fsname;
-+	struct xvfsconf *vfcp;
-+{
-+	struct xvfsconf *xvfsp;
-+	size_t buflen;
-+	int cnt, i;
-+
-+	if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0)
-+		return (-1);
-+	xvfsp = malloc(buflen);
-+	if (xvfsp == NULL)
-+		return (-1);
-+	if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) {
-+		free(xvfsp);
-+		return (-1);
-+	}
-+	cnt = buflen / sizeof(struct xvfsconf);
-+	for (i = 0; i < cnt; i++) {
-+		if (strcmp(fsname, xvfsp[i].vfc_name) == 0) {
-+			memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf));
-+			free(xvfsp);
-+			return (0);
-+		}
-+	}
-+	free(xvfsp);
-+	errno = ENOENT;
-+	return (-1);
-+}
---- a/usr.sbin/mountd/Makefile
-+++ b/usr.sbin/mountd/Makefile
-@@ -2,14 +2,14 @@
- # $FreeBSD$
- 
- PROG=	mountd
--SRCS=	mountd.c getmntopts.c
-+SRCS=	mountd.c getmntopts.c getvfsbyname.c nfssvc.c
- MAN=	exports.5 netgroup.5 mountd.8
- 
- MOUNT=  ${.CURDIR}/../../sbin/mount
- CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys
- WARNS?= 2
- 
--.PATH: ${MOUNT}
-+.PATH: ${MOUNT} ${.CURDIR}/../../extra
- 
- DPADD=	${LIBUTIL}
- LDADD=	-ltirpc -lbsd
---- /dev/null
-+++ b/extra/nfssvc.c
-@@ -0,0 +1,7 @@
-+#include <sys/syscall.h>
-+
-+int
-+nfssvc (int a, void *b)
-+{
-+  return syscall (SYS_nfssvc, a, b);
-+}
---- a/usr.sbin/nfsd/Makefile
-+++ b/usr.sbin/nfsd/Makefile
-@@ -2,10 +2,13 @@
- # $FreeBSD$
- 
- PROG=	nfsd
-+SRCS=	nfsd.c nfssvc.c
- MAN=	nfsd.8 nfsv4.4 stablerestart.5
- CFLAGS+= -I${.CURDIR}/../../sys
- LDADD=   -ltirpc -lbsd
- 
-+.PATH: ${.CURDIR}/../../extra
-+
- WARNS?=	6
- 
- .include <bsd.prog.mk>
 --- a/usr.sbin/rpc.lockd/Makefile
 +++ b/usr.sbin/rpc.lockd/Makefile
-@@ -4,7 +4,7 @@
- PROG=	rpc.lockd
+@@ -5,7 +5,7 @@
  MAN=	rpc.lockd.8
  MLINKS=	rpc.lockd.8 lockd.8
--SRCS=	kern.c nlm_prot_svc.c nlm_prot_xdr.c lockd.c lock_proc.c lockd_lock.c sm_inter_xdr.c
-+SRCS=	kern.c nlm_prot_svc.c nlm_prot_xdr.c lockd.c lock_proc.c lockd_lock.c sm_inter_xdr.c nlm_syscall.c
+ SRCS=	kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
+-SRCS+=	nlm_prot_xdr.c sm_inter_xdr.c
++SRCS+=	nlm_prot_xdr.c sm_inter_xdr.c nlm_syscall.c
  
  CFLAGS+= -I. -I${.CURDIR}/../../include/rpcsvc
- #WARNS?= 2
+ WARNS?= 3
 --- /dev/null
 +++ b/usr.sbin/rpc.lockd/nlm_syscall.c
 @@ -0,0 +1,11 @@

Deleted: trunk/freebsd-utils/debian/patches/037_mount_autofs.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/037_mount_autofs.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/037_mount_autofs.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,13 +0,0 @@
---- a/sbin/mount_autofs/mount_autofs.c
-+++ b/sbin/mount_autofs/mount_autofs.c
-@@ -69,8 +69,8 @@
- mymount(
- 	const char *type,
- 	const char *dir,
--	int flags __attribute__((unused)),
--	void *data __attribute__((unused))
-+	int flags,
-+	void *data
- )
- {
- 	struct iovec iov[4], *iovp;

Modified: trunk/freebsd-utils/debian/patches/038_jail.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/038_jail.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/038_jail.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -8,7 +8,7 @@
  #include <netdb.h>
  #include <paths.h>
  #include <pwd.h>
-@@ -93,9 +92,6 @@
+@@ -99,9 +98,6 @@
  		else							\
  			errx(1, "%s: no such user", username);		\
  	}								\
@@ -18,7 +18,7 @@
  	ngroups = ngroups_max;						\
  	if (getgrouplist(username, pwd->pw_gid, groups, &ngroups) != 0)	\
  		err(1, "getgrouplist: %s", username);			\
-@@ -104,7 +100,6 @@
+@@ -110,7 +106,6 @@
  int
  main(int argc, char **argv)
  {
@@ -26,7 +26,7 @@
  	struct passwd *pwd = NULL;
  	gid_t *groups;
  	size_t sysvallen;
-@@ -326,10 +321,6 @@
+@@ -350,10 +345,6 @@
  			err(1, "setgroups");
  		if (setgid(pwd->pw_gid) != 0)
  			err(1, "setgid");

Modified: trunk/freebsd-utils/debian/patches/039_geom.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/039_geom.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/039_geom.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,22 +1,11 @@
 --- a/sbin/geom/Makefile.inc
 +++ b/sbin/geom/Makefile.inc
-@@ -2,5 +2,3 @@
+@@ -1,5 +1,3 @@
+ # $FreeBSD$
  
- WARNS?=	6
- CLASS_DIR?=/lib/geom
+ GEOM_CLASS_DIR?=/lib/geom
 -
 -.include "../Makefile.inc"
---- a/sbin/geom/class/eli/geom_eli.c
-+++ b/sbin/geom/class/eli/geom_eli.c
-@@ -1083,7 +1083,7 @@
- }
- 
- static void
--eli_delkey_attached(struct gctl_req *req, const char *prov __attribute__((unused)))
-+eli_delkey_attached(struct gctl_req *req, const char *prov)
- {
- 
- 	gctl_issue(req);
 --- a/sbin/geom/class/eli/Makefile
 +++ b/sbin/geom/class/eli/Makefile
 @@ -9,7 +9,7 @@
@@ -28,131 +17,9 @@
  
  WARNS?=	3
  
---- a/sbin/geom/class/multipath/geom_multipath.c
-+++ b/sbin/geom/class/multipath/geom_multipath.c
-@@ -79,7 +79,7 @@
- };
- 
- static void
--mp_main(struct gctl_req *req, unsigned int flags __attribute__((unused)))
-+mp_main(struct gctl_req *req, unsigned int flags)
- {
- 	const char *name;
- 
---- a/sbin/geom/class/part/geom_part.c
-+++ b/sbin/geom/class/part/geom_part.c
-@@ -622,7 +622,7 @@
- }
- 
- static void
--gpart_show(struct gctl_req *req, unsigned int fl __attribute__((unused)))
-+gpart_show(struct gctl_req *req, unsigned int fl)
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -668,7 +668,7 @@
- }
- 
- static void
--gpart_backup(struct gctl_req *req, unsigned int fl __attribute__((unused)))
-+gpart_backup(struct gctl_req *req, unsigned int fl)
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -757,13 +757,13 @@
- }
- 
- static void
--gpart_sighndl(int sig __attribute__((unused)))
-+gpart_sighndl(int sig)
- {
- 	undo_restore = 1;
- }
- 
- static void
--gpart_restore(struct gctl_req *req, unsigned int fl __attribute__((unused)))
-+gpart_restore(struct gctl_req *req, unsigned int fl)
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -1211,7 +1211,7 @@
- }
- 
- static void
--gpart_issue(struct gctl_req *req, unsigned int fl __attribute__((unused)))
-+gpart_issue(struct gctl_req *req, unsigned int fl)
- {
- 	char buf[4096];
- 	const char *errstr;
---- a/sbin/geom/class/sched/geom_sched.c
-+++ b/sbin/geom/class/sched/geom_sched.c
-@@ -68,7 +68,7 @@
- #endif
- 
- static void
--gcmd_createinsert(struct gctl_req *req, unsigned flags __attribute__((unused)))
-+gcmd_createinsert(struct gctl_req *req, unsigned flags)
- {
- 	const char *reqalgo;
- 	char name[64];
---- a/sbin/geom/core/geom.c
-+++ b/sbin/geom/core/geom.c
-@@ -770,7 +770,7 @@
- }
- 
- static void
--std_help(struct gctl_req *req __attribute__((unused)), unsigned flags __attribute__((unused)))
-+std_help(struct gctl_req *req, unsigned flags)
- {
- 
- 	usage();
-@@ -794,7 +794,7 @@
- }
- 
- static void
--std_list(struct gctl_req *req, unsigned flags __attribute__((unused)))
-+std_list(struct gctl_req *req, unsigned flags)
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -928,7 +928,7 @@
- }
- 
- static void
--std_status(struct gctl_req *req, unsigned flags __attribute__((unused)))
-+std_status(struct gctl_req *req, unsigned flags)
- {
- 	struct gmesh mesh;
- 	struct gclass *classp;
-@@ -1024,7 +1024,7 @@
- }
- 
- static void
--std_load(struct gctl_req *req __attribute__((unused)), unsigned flags)
-+std_load(struct gctl_req *req, unsigned flags)
- {
- 
- 	/*
-@@ -1049,7 +1049,7 @@
- }
- 
- static void
--std_unload(struct gctl_req *req, unsigned flags __attribute__((unused)))
-+std_unload(struct gctl_req *req, unsigned flags)
- {
- 	char name[64];
- 	int id;
 --- a/sbin/geom/misc/subr.c
 +++ b/sbin/geom/misc/subr.c
-@@ -47,7 +47,6 @@
- 
- #include "misc/subr.h"
- 
--
- struct std_metadata {
- 	char		md_magic[16];
- 	uint32_t	md_version;
-@@ -187,7 +186,7 @@
+@@ -177,7 +177,7 @@
  	if (*s != '\0')
  		return (EINVAL);
  done:
@@ -163,7 +30,7 @@
  	if (number % sectorsize)
 --- a/sbin/geom/Makefile
 +++ b/sbin/geom/Makefile
-@@ -14,7 +14,7 @@
+@@ -15,7 +15,7 @@
  CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES
  
  DPADD=	${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL}
@@ -174,31 +41,29 @@
  
 --- a/sbin/geom/class/Makefile
 +++ b/sbin/geom/class/Makefile
-@@ -7,16 +7,16 @@
+@@ -7,18 +7,14 @@
  .if ${MK_OPENSSL} != "no"
  SUBDIR+=eli
  .endif
 -SUBDIR+=journal
-+#SUBDIR+=journal
  SUBDIR+=label
  SUBDIR+=mirror
+ SUBDIR+=mountver
 -SUBDIR+=multipath
-+#SUBDIR+=multipath
  SUBDIR+=nop
 -SUBDIR+=part
-+#SUBDIR+=part
+ SUBDIR+=raid
  SUBDIR+=raid3
  SUBDIR+=sched
  SUBDIR+=shsec
  SUBDIR+=stripe
 -SUBDIR+=virstor
-+#SUBDIR+=virstor
  
  .include <bsd.subdir.mk>
 --- a/sbin/geom/class/mirror/Makefile
 +++ b/sbin/geom/class/mirror/Makefile
 @@ -5,6 +5,6 @@
- CLASS=	mirror
+ GEOM_CLASS=	mirror
  
  DPADD=	${LIBMD}
 -LDADD=	-lmd
@@ -208,7 +73,7 @@
 --- a/sbin/geom/class/raid3/Makefile
 +++ b/sbin/geom/class/raid3/Makefile
 @@ -5,6 +5,6 @@
- CLASS=	raid3
+ GEOM_CLASS=	raid3
  
  DPADD=	${LIBMD}
 -LDADD=	-lmd
@@ -352,3 +217,13 @@
  #endif
  
  
+--- a/sbin/geom/class/raid/Makefile
++++ b/sbin/geom/class/raid/Makefile
+@@ -5,6 +5,6 @@
+ GEOM_CLASS=	raid
+ 
+ DPADD=	${LIBMD}
+-LDADD=	-lmd
++#LDADD=	-lmd
+ 
+ .include <bsd.lib.mk>

Deleted: trunk/freebsd-utils/debian/patches/040_kdump_multiarch.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/040_kdump_multiarch.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/040_kdump_multiarch.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,119 +0,0 @@
---- a/usr.bin/kdump/Makefile
-+++ b/usr.bin/kdump/Makefile
-@@ -11,9 +11,9 @@
- CLEANFILES=	ioctl.c kdump_subr.c
- 
- ioctl.c: mkioctls
--	sh ${.CURDIR}/mkioctls /usr/include > ${.TARGET}
-+	sh ${.CURDIR}/mkioctls /usr/include /usr/include/*-kfreebsd-gnu > ${.TARGET}
- 
- kdump_subr.c: mksubr
--	sh ${.CURDIR}/mksubr /usr/include > ${.TARGET}
-+	sh ${.CURDIR}/mksubr /usr/include /usr/include/*-kfreebsd-gnu > ${.TARGET}
- 
- .include <bsd.prog.mk>
---- a/usr.bin/kdump/mkioctls
-+++ b/usr.bin/kdump/mkioctls
-@@ -15,21 +15,23 @@
- 	echo "usage: sh $0 [-s] include-dir"
- 	exit 1
- fi
-+include_dirs="$*"
- 
- LC_ALL=C; export LC_ALL
- 
- # Build a list of headers that have ioctls in them.
- # XXX should we use an ANSI cpp?
- ioctl_includes=`
--	cd $1
--	find -H -s * -name '*.h' |
-+	for include_dir in $include_dirs ; do \
-+	cd $include_dir
-+	find -H -s * -name '*.h' ; done |
- 		xargs egrep -l \
- '^#[ 	]*define[ 	]+[A-Za-z_][A-Za-z0-9_]*[ 	]+_IO[^a-z0-9_]' |
- 		awk '{printf("#include <%s>\\\\n", $1)}'
- `
- 
- awk -v x="$ioctl_includes" 'BEGIN {print x}' |
--	gcc -E -I$1 -dM -DCOMPAT_43TTY - |
-+	gcc -E -dM -DCOMPAT_43TTY - |
- 	awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
- BEGIN {
- 	print "/* XXX obnoxious prerequisites. */"
---- a/usr.bin/kdump/mksubr
-+++ b/usr.bin/kdump/mksubr
-@@ -27,7 +27,7 @@
- 	echo "usage: sh $0 include-dir"
- 	exit 1
- fi
--include_dir=$1
-+include_dirs="$*"
- 
- #
- # Automatically generates a C function that will print out the
-@@ -50,8 +50,9 @@
- {
- 	int	or = 0;
- _EOF_
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
- 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
--		$include_dir/$file | \
-+		$include_dir/$file ; fi ; done | \
- 	awk '{ for (i = 1; i <= NF; i++) \
- 		if ($i ~ /define/) \
- 			break; \
-@@ -84,8 +85,9 @@
- {
- 	switch (arg) {
- _EOF_
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
- 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
--		$include_dir/$file | \
-+		$include_dir/$file ; fi ; done | \
- 	awk '{ for (i = 1; i <= NF; i++) \
- 		if ($i ~ /define/) \
- 			break; \
-@@ -116,8 +118,9 @@
- $name (int arg)
- {
- _EOF_
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
- 	egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
--		$include_dir/$file | \
-+		$include_dir/$file ; fi ; done | \
- 	awk '{ printf "\t"; \
- 		if (NR > 1) \
- 			printf "else " ; \
-@@ -395,8 +398,9 @@
- {
- 	switch (cmd) {
- _EOF_
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
- egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \
--	$include_dir/sys/fcntl.h | \
-+	$include_dir/sys/fcntl.h ; fi ; done | \
- 	awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \
- 		if ($i ~ /define/) \
- 			break; \
-@@ -444,8 +448,9 @@
- {
- 	switch (func) {
- _EOF_
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
- egrep "^#[[:space:]]*define[[:space:]]+RTP_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \
--	$include_dir/sys/rtprio.h | grep -v RTP_PRIO | \
-+	$include_dir/sys/rtprio.h ; fi ; done | grep -v RTP_PRIO | \
- 	awk '{ for (i = 1; i <= NF; i++) \
- 		if ($i ~ /define/) \
- 			break; \
-@@ -474,7 +479,8 @@
- 		return;
- 	}
- _EOF_
--egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]*" $include_dir/bits/socket.h | \
-+	for include_dir in $include_dirs ; do if test -e $include_dir/$file ; then \
-+egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]*" $include_dir/bits/socket.h ; fi ; done | \
- 	awk '{ for (i = 1; i <= NF; i++) \
- 		if ($i ~ /define/) \
- 			break; \

Modified: trunk/freebsd-utils/debian/patches/043_ppp.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/043_ppp.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/043_ppp.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -130,6 +130,7 @@
  #define ID0fopen fopen
  #define ID0open open
  #define ID0write write
++
 +#if defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
 +#include <lockdev.h>
 +#define ID0uu_lock dev_lock
@@ -141,22 +142,21 @@
  #define ID0uu_lock_txfr uu_lock_txfr
  #define ID0uu_unlock uu_unlock
 +#endif
-+
- #define ID0login(u)			\
-   do {					\
-     if (logout((u)->ut_line))		\
+ #define ID0login pututxline
+ #define ID0logout pututxline
+ #define ID0bind_un(s, n) bind(s, (const struct sockaddr *)(n), sizeof *(n))
 --- a/usr.sbin/ppp/physical.c
 +++ b/usr.sbin/ppp/physical.c
-@@ -41,6 +41,8 @@
+@@ -42,6 +42,8 @@
  #include <sysexits.h>
  #include <termios.h>
  #include <time.h>
 +// this is mislead about the getpgrp() declaration
 +#undef __FAVOR_BSD
  #include <unistd.h>
- #include <utmp.h>
+ #include <utmpx.h>
  #if defined(__OpenBSD__) || defined(__NetBSD__)
-@@ -308,11 +310,15 @@
+@@ -307,11 +309,15 @@
  
    if (*p->name.full == '/' && p->type != PHYS_DIRECT &&
        (res = ID0uu_lock(p->name.base)) != UU_LOCK_OK) {
@@ -172,7 +172,7 @@
      return 0;
    }
  
-@@ -323,7 +329,12 @@
+@@ -322,7 +328,12 @@
  physical_Unlock(struct physical *p)
  {
    if (*p->name.full == '/' && p->type != PHYS_DIRECT &&
@@ -186,7 +186,7 @@
      log_Printf(LogALERT, "%s: Can't uu_unlock %s\n", p->link.name,
                 p->name.base);
  }
-@@ -762,7 +773,11 @@
+@@ -761,7 +772,11 @@
      int res;
  
      if ((res = ID0uu_lock_txfr(p->name.base, newpid)) != UU_LOCK_OK)

Modified: trunk/freebsd-utils/debian/patches/044_mount_exec.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/044_mount_exec.diff	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/044_mount_exec.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -3,7 +3,7 @@
 
 --- a/sbin/mount/mount.c
 +++ b/sbin/mount/mount.c
-@@ -160,7 +160,6 @@
+@@ -161,7 +161,6 @@
  static int
  exec_mountprog(const char *name, const char *execname, char *const argv[])
  {
@@ -11,7 +11,7 @@
  	pid_t pid;
  	int status;
  
-@@ -169,9 +168,7 @@
+@@ -170,9 +169,7 @@
  		warn("fork");
  		exit (1);
  	case 0:					/* Child. */

Added: trunk/freebsd-utils/debian/patches/ifconfig_nojail.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/ifconfig_nojail.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/ifconfig_nojail.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,64 @@
+--- a/sbin/ifconfig/Makefile
++++ b/sbin/ifconfig/Makefile
+@@ -33,8 +33,8 @@
+ SRCS+=	ifgif.c			# GIF reversed header workaround
+ 
+ SRCS+=	ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
+-DPADD+=	${LIBBSDXML} ${LIBJAIL} ${LIBSBUF}
+-LDADD+=	-lexpat -ljail -lsbuf
++DPADD+=	${LIBBSDXML} ${LIBSBUF}
++LDADD+=	-lexpat -lsbuf
+ 
+ SRCS+=	ifcarp.c		# SIOC[GS]VH support
+ SRCS+=	ifgroup.c		# ...
+@@ -53,6 +53,11 @@
+ DPADD+=	${LIBIPX}
+ LDADD+=	-lipx
+ .endif
++.if ${MK_JAIL} != "no"
++CFLAGS+= -DJAIL
++DPADD+= ${LIBJAIL}
++LDADD+= -ljail
++.endif
+ 
+ MAN=	ifconfig.8
+ 
+--- a/sbin/ifconfig/ifconfig.c
++++ b/sbin/ifconfig/ifconfig.c
+@@ -70,7 +70,9 @@
+ #include <err.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#ifdef JAIL
+ #include <jail.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -692,6 +694,7 @@
+ 		err(1, "SIOCDIFPHYADDR");
+ }
+ 
++#ifdef JAIL
+ static void
+ setifvnet(const char *jname, int dummy __unused, int s,
+     const struct afswtch *afp)
+@@ -719,6 +722,7 @@
+ 	if (ioctl(s, SIOCSIFRVNET, &my_ifr) < 0)
+ 		err(1, "SIOCSIFRVNET(%d, %s)", my_ifr.ifr_jid, my_ifr.ifr_name);
+ }
++#endif
+ 
+ static void
+ setifnetmask(const char *addr, int dummy __unused, int s,
+@@ -1162,8 +1166,10 @@
+ 	DEF_CMD_ARG2("tunnel",			settunnel),
+ 	DEF_CMD("-tunnel", 0,			deletetunnel),
+ 	DEF_CMD("deletetunnel", 0,		deletetunnel),
++#ifdef JAIL
+ 	DEF_CMD_ARG("vnet",			setifvnet),
+ 	DEF_CMD_ARG("-vnet",			setifrvnet),
++#endif
+ 	DEF_CMD("link0",	IFF_LINK0,	setifflags),
+ 	DEF_CMD("-link0",	-IFF_LINK0,	setifflags),
+ 	DEF_CMD("link1",	IFF_LINK1,	setifflags),

Added: trunk/freebsd-utils/debian/patches/pf_regex_c.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/pf_regex_c.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/pf_regex_c.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,8395 @@
+
+Generated with:
+
+find b -type f -name \*.c -or -name \*.y | while read i ; do \
+	sed -i $i \
+		-e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/defined(__FreeBSD_kernel__)/g' \
+		-e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#ifdef __FreeBSD_kernel__/g' \
+		-e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#ifndef __FreeBSD_kernel__/g' \
+	; done
+
+--- a/contrib/pf/pfctl/parse.y
++++ b/contrib/pf/pfctl/parse.y
+@@ -2223,7 +2223,7 @@
+ 				}
+ 				free($9.queues.pqname);
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			r.divert.port = $9.divert.port;
+ #else
+ 			if ((r.divert.port = $9.divert.port)) {
+@@ -2368,7 +2368,7 @@
+ 			filter_opts.rtableid = $2;
+ 		}
+ 		| DIVERTTO portplain {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			filter_opts.divert.port = $2.a;
+ 			if (!filter_opts.divert.port) {
+ 				yyerror("invalid divert port: %u", ntohs($2.a));
+@@ -2377,7 +2377,7 @@
+ #endif
+ 		}
+ 		| DIVERTTO STRING PORT portplain {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 			if ((filter_opts.divert.addr = host($2)) == NULL) {
+ 				yyerror("could not parse divert address: %s",
+ 				    $2);
+@@ -2395,7 +2395,7 @@
+ 			}
+ 		}
+ 		| DIVERTREPLY {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			yyerror("divert-reply has no meaning in FreeBSD pf(4)");
+ 			YYERROR;
+ #else
+@@ -2861,7 +2861,7 @@
+ 			char	*buf;
+ 
+ 			/* ie. for 10/8 parsing */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (asprintf(&buf, "%lld/%lld", (long long)$1, (long long)$3) == -1)
+ #else
+ 			if (asprintf(&buf, "%lld/%lld", $1, $3) == -1)
+--- a/contrib/pf/authpf/authpf.c
++++ b/contrib/pf/authpf/authpf.c
+@@ -33,7 +33,7 @@
+ 
+ #include <err.h>
+ #include <errno.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <inttypes.h>
+ #endif
+ #include <login_cap.h>
+@@ -74,7 +74,7 @@
+ 
+ volatile sig_atomic_t	want_death;
+ static void		need_death(int signo);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static __dead2 void	do_death(int);
+ #else
+ static __dead void	do_death(int);
+@@ -155,7 +155,7 @@
+ 	else
+ 		shell = pw->pw_shell;
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	login_close(lc);
+ #endif
+ 
+@@ -163,7 +163,7 @@
+ 	    strcmp(shell, PATH_AUTHPF_SHELL_NOIP)) {
+ 		syslog(LOG_ERR, "wrong shell for user %s, uid %u",
+ 		    pw->pw_name, pw->pw_uid);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	login_close(lc);
+ #else
+ 		if (shell != pw->pw_shell)
+@@ -172,7 +172,7 @@
+ 		goto die;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	login_close(lc);
+ #else
+ 	if (shell != pw->pw_shell)
+@@ -932,7 +932,7 @@
+ /*
+  * function that removes our stuff when we go away.
+  */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static __dead2 void
+ #else
+ static __dead void
+--- a/contrib/pf/ftp-proxy/ftp-proxy.c
++++ b/contrib/pf/ftp-proxy/ftp-proxy.c
+@@ -585,7 +585,7 @@
+ 
+ 		/* We don't care about truncation. */
+ 		vsnprintf(buf, sizeof buf, message, ap);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		strvis(visbuf, buf, VIS_CSTYLE | VIS_NL);
+ #else
+ 		strnvis(visbuf, buf, sizeof visbuf, VIS_CSTYLE | VIS_NL);
+--- a/contrib/pf/libevent/kqueue.c
++++ b/contrib/pf/libevent/kqueue.c
+@@ -48,7 +48,7 @@
+ #include <inttypes.h>
+ #endif
+ 
+-#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__)
++#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD_kernel__)
+ #define INTPTR(x)	(intptr_t)x
+ #else
+ #define INTPTR(x)	x
+--- a/contrib/pf/pfctl/pf_print_state.c
++++ b/contrib/pf/pfctl/pf_print_state.c
+@@ -35,7 +35,7 @@
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/endian.h>
+ #define	betoh64	be64toh
+ #endif
+@@ -322,7 +322,7 @@
+ 		bcopy(s->bytes[0], &bytes[0], sizeof(u_int64_t));
+ 		bcopy(s->bytes[1], &bytes[1], sizeof(u_int64_t));
+ 		printf(", %llu:%llu pkts, %llu:%llu bytes",
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    (unsigned long long)betoh64(packets[0]),
+ 		    (unsigned long long)betoh64(packets[1]),
+ 		    (unsigned long long)betoh64(bytes[0]),
+@@ -352,7 +352,7 @@
+ 
+ 		bcopy(&s->id, &id, sizeof(u_int64_t));
+ 		printf("   id: %016llx creatorid: %08x",
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    (unsigned long long)betoh64(id), ntohl(s->creatorid));
+ #else
+ 		    betoh64(id), ntohl(s->creatorid));
+--- a/contrib/pf/pfctl/pfctl.c
++++ b/contrib/pf/pfctl/pfctl.c
+@@ -39,7 +39,7 @@
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/endian.h>
+ #endif
+ 
+@@ -251,7 +251,7 @@
+ 	if (ioctl(dev, DIOCSTART)) {
+ 		if (errno == EEXIST)
+ 			errx(1, "pf already enabled");
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (errno == ESRCH)
+ 			errx(1, "pfil registeration failed");
+ #endif
+@@ -1585,7 +1585,7 @@
+ 	pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT;
+ 
+ 	mib[0] = CTL_HW;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	mib[1] = HW_PHYSMEM;
+ #else
+ 	mib[1] = HW_PHYSMEM64;
+@@ -2202,7 +2202,7 @@
+ 		/* turn off options */
+ 		opts &= ~ (PF_OPT_DISABLE | PF_OPT_ENABLE);
+ 		clearopt = showopt = debugopt = NULL;
+-#if defined(__FreeBSD__) && !defined(ENABLE_ALTQ)
++#if defined(__FreeBSD_kernel__) && !defined(ENABLE_ALTQ)
+ 		altqsupport = 0;
+ #else
+ 		altqsupport = 1;
+--- a/contrib/pf/pfctl/pfctl_altq.c
++++ b/contrib/pf/pfctl/pfctl_altq.c
+@@ -77,7 +77,7 @@
+ 			     double);
+ static double		 sc_x2y(struct service_curve *, double);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ u_int32_t	getifspeed(int, char *);
+ #else
+ u_int32_t	 getifspeed(char *);
+@@ -153,7 +153,7 @@
+ 		return;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (a->local_flags & PFALTQ_FLAG_IF_REMOVED)
+ 		printf("INACTIVE ");
+ #endif
+@@ -193,7 +193,7 @@
+ {
+ 	unsigned int	i;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (a->local_flags & PFALTQ_FLAG_IF_REMOVED)
+ 		printf("INACTIVE ");
+ #endif
+@@ -239,7 +239,7 @@
+ 	if (bw->bw_absolute > 0)
+ 		pa->ifbandwidth = bw->bw_absolute;
+ 	else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((rate = getifspeed(pf->dev, pa->ifname)) == 0) {
+ #else
+ 		if ((rate = getifspeed(pa->ifname)) == 0) {
+@@ -1095,7 +1095,7 @@
+ 	return (buf);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ /*
+  * XXX
+  * FreeBSD does not have SIOCGIFDATA.
+@@ -1150,7 +1150,7 @@
+ 	    sizeof(ifr.ifr_name))
+ 		errx(1, "getifmtu: strlcpy");
+ 	if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) == -1)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		ifr.ifr_mtu = 1500;
+ #else
+ 		err(1, "SIOCGIFMTU");
+--- a/contrib/pf/pfctl/pfctl_optimize.c
++++ b/contrib/pf/pfctl/pfctl_optimize.c
+@@ -862,7 +862,7 @@
+ 				break;
+ 			}
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (por2 == NULL)
+ #else
+ 		if (por2 == TAILQ_END(&block->sb_rules))
+--- a/contrib/pf/pfctl/pfctl_parser.c
++++ b/contrib/pf/pfctl/pfctl_parser.c
+@@ -580,7 +580,7 @@
+ 		    s->src_nodes, "");
+ 		for (i = 0; i < SCNT_MAX; i++) {
+ 			printf("  %-25s %14lld ", pf_scounters[i],
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    (long long)s->scounters[i]);
+ #else
+ 				    s->scounters[i]);
+@@ -606,7 +606,7 @@
+ 		printf("Limit Counters\n");
+ 		for (i = 0; i < LCNT_MAX; i++) {
+ 			printf("  %-25s %14lld ", pf_lcounters[i],
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    (unsigned long long)s->lcounters[i]);
+ #else
+ 				    s->lcounters[i]);
+@@ -655,7 +655,7 @@
+ 			    sn->expire, min, sec);
+ 		}
+ 		printf(", %llu pkts, %llu bytes",
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    (unsigned long long)(sn->packets[0] + sn->packets[1]),
+ 		    (unsigned long long)(sn->bytes[0] + sn->bytes[1]));
+ #else
+@@ -1019,7 +1019,7 @@
+ 	if (r->rtableid != -1)
+ 		printf(" rtable %u", r->rtableid);
+ 	if (r->divert.port) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		printf(" divert-to %u", ntohs(r->divert.port));
+ #else
+ 		if (PF_AZERO(&r->divert.addr, r->af)) {
+--- a/contrib/pf/pfctl/pfctl_qstats.c
++++ b/contrib/pf/pfctl/pfctl_qstats.c
+@@ -89,7 +89,7 @@
+ 	struct pf_altq_node	*root = NULL, *node;
+ 	int			 nodes, dotitle = (opts & PF_OPT_SHOWALL);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!altqsupport)
+ 		return (-1);
+ #endif
+@@ -118,7 +118,7 @@
+ 		for (node = root; node != NULL; node = node->next) {
+ 			if (iface != NULL && strcmp(node->altq.ifname, iface))
+ 				continue;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (node->altq.local_flags & PFALTQ_FLAG_IF_REMOVED)
+ 				continue;
+ #endif
+@@ -161,7 +161,7 @@
+ 			warn("DIOCGETALTQ");
+ 			return (-1);
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pa.altq.qid > 0 &&
+ 		    !(pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED)) {
+ #else
+@@ -184,7 +184,7 @@
+ 				pfctl_insert_altq_node(root, pa.altq, qstats);
+ 			}
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (pa.altq.local_flags & PFALTQ_FLAG_IF_REMOVED) {
+ 			memset(&qstats.data, 0, sizeof(qstats.data));
+ 			if ((node = pfctl_find_altq_node(*root, pa.altq.qname,
+@@ -303,7 +303,7 @@
+ 	if (a->altq.qid == 0)
+ 		return;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (a->altq.local_flags & PFALTQ_FLAG_IF_REMOVED)
+ 		return;
+ #endif
+--- a/contrib/pf/pflogd/pflogd.c
++++ b/contrib/pf/pflogd/pflogd.c
+@@ -51,7 +51,7 @@
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <fcntl.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <ifaddrs.h>
+ #include "pidfile.h"
+ #else
+@@ -161,7 +161,7 @@
+ 	va_end(ap);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ __dead2 void
+ #else
+ __dead void
+@@ -215,7 +215,7 @@
+ int
+ if_exists(char *ifname)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ifaddrs *ifdata, *mb;
+ 	int exists = 0;
+ 
+@@ -406,7 +406,7 @@
+ scan_dump(FILE *fp, off_t size)
+ {
+ 	struct pcap_file_header hdr;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pcap_sf_pkthdr ph;
+ #else
+ 	struct pcap_pkthdr ph;
+@@ -479,7 +479,7 @@
+ dump_packet_nobuf(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
+ {
+ 	FILE *f = (FILE *)user;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pcap_sf_pkthdr sh;
+ #endif
+ 
+@@ -488,7 +488,7 @@
+ 		return;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sh.ts.tv_sec = (bpf_int32)h->ts.tv_sec;
+ 	sh.ts.tv_usec = (bpf_int32)h->ts.tv_usec;
+ 	sh.caplen = h->caplen;
+@@ -501,7 +501,7 @@
+ 		off_t pos = ftello(f);
+ 
+ 		/* try to undo header to prevent corruption */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pos < sizeof(sh) ||
+ 		    ftruncate(fileno(f), pos - sizeof(sh))) {
+ #else
+@@ -576,7 +576,7 @@
+ dump_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
+ {
+ 	FILE *f = (FILE *)user;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pcap_sf_pkthdr sh;
+ 	size_t len = sizeof(sh) + h->caplen;
+ #else
+@@ -609,7 +609,7 @@
+ 	}
+ 
+  append:       
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sh.ts.tv_sec = (bpf_int32)h->ts.tv_sec;
+ 	sh.ts.tv_usec = (bpf_int32)h->ts.tv_usec;
+ 	sh.caplen = h->caplen;
+--- a/contrib/pf/pflogd/pidfile.c
++++ b/contrib/pf/pflogd/pidfile.c
+@@ -48,7 +48,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "pidfile.h"
+ #else
+ #include <util.h>
+--- a/contrib/pf/pflogd/privsep.c
++++ b/contrib/pf/pflogd/privsep.c
+@@ -73,7 +73,7 @@
+ 	int snaplen, ret, olderrno;
+ 	struct passwd *pw;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	for (i = 1; i < NSIG; i++)
+ #else
+ 	for (i = 1; i < _NSIG; i++)
+--- a/contrib/pf/tftp-proxy/filter.c
++++ b/contrib/pf/tftp-proxy/filter.c
+@@ -298,7 +298,7 @@
+ 		pfr.rule.quick = 1;
+ 		pfr.rule.log = rule_log;
+ 		pfr.rule.keep_state = 1;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pfr.rule.flags = (proto == IPPROTO_TCP ? TH_SYN : 0);
+ 		pfr.rule.flagset = (proto == IPPROTO_TCP ?
+ 		    (TH_SYN|TH_ACK|TH_FIN|TH_RST) : 0);
+--- a/sys/contrib/pf/net/if_pflog.c
++++ b/sys/contrib/pf/net/if_pflog.c
+@@ -33,7 +33,7 @@
+  * PURPOSE.
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ #include "opt_bpf.h"
+@@ -64,7 +64,7 @@
+ #include <sys/mbuf.h>
+ #include <sys/proc.h>
+ #include <sys/socket.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/kernel.h>
+ #include <sys/limits.h>
+ #include <sys/malloc.h>
+@@ -75,7 +75,7 @@
+ #endif
+ 
+ #include <net/if.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <net/if_clone.h>
+ #endif
+ #include <net/if_types.h>
+@@ -99,7 +99,7 @@
+ #include <net/pfvar.h>
+ #include <net/if_pflog.h>
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef INET
+ #include <machine/in_cksum.h>
+ #endif /* INET */
+@@ -115,14 +115,14 @@
+ 
+ void	pflogattach(int);
+ int	pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	    struct route *);
+ #else
+ 	    struct rtentry *);
+ #endif
+ int	pflogioctl(struct ifnet *, u_long, caddr_t);
+ void	pflogstart(struct ifnet *);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static int pflog_clone_create(struct if_clone *, int, caddr_t);
+ static void pflog_clone_destroy(struct ifnet *);
+ #else
+@@ -131,7 +131,7 @@
+ #endif
+ 
+ LIST_HEAD(, pflog_softc)	pflogif_list;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ IFC_SIMPLE_DECLARE(pflog, 1);
+ #else
+ struct if_clone	pflog_cloner =
+@@ -150,7 +150,7 @@
+ 	if_clone_attach(&pflog_cloner);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static int
+ pflog_clone_create(struct if_clone *ifc, int unit, caddr_t param)
+ #else
+@@ -170,7 +170,7 @@
+ 		return (ENOMEM);
+ 
+ 	pflogif->sc_unit = unit;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	ifp = pflogif->sc_ifp = if_alloc(IFT_PFLOG);
+ 	if (ifp == NULL) {
+ 		free(pflogif, M_DEVBUF);
+@@ -186,18 +186,18 @@
+ 	ifp->if_ioctl = pflogioctl;
+ 	ifp->if_output = pflogoutput;
+ 	ifp->if_start = pflogstart;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	ifp->if_type = IFT_PFLOG;
+ #endif
+ 	ifp->if_snd.ifq_maxlen = ifqmaxlen;
+ 	ifp->if_hdrlen = PFLOG_HDRLEN;
+ 	if_attach(ifp);
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	if_alloc_sadl(ifp);
+ #endif
+ 
+ #if NBPFILTER > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN);
+ #else
+ 	bpfattach(&pflogif->sc_if.if_bpf, ifp, DLT_PFLOG, PFLOG_HDRLEN);
+@@ -205,13 +205,13 @@
+ #endif
+ 
+ 	s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX: Why pf(4) lock?! Better add a pflog lock?! */
+ 	PF_LOCK();
+ #endif
+ 	LIST_INSERT_HEAD(&pflogif_list, pflogif, sc_list);
+ 	pflogifs[unit] = ifp;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -219,7 +219,7 @@
+ 	return (0);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static void
+ pflog_clone_destroy(struct ifnet *ifp)
+ #else
+@@ -231,12 +231,12 @@
+ 	int			 s;
+ 
+ 	s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	pflogifs[pflogif->sc_unit] = NULL;
+ 	LIST_REMOVE(pflogif, sc_list);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -245,11 +245,11 @@
+ 	bpfdetach(ifp);
+ #endif
+ 	if_detach(ifp);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if_free(ifp);
+ #endif
+ 	free(pflogif, M_DEVBUF);
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	return (0);
+ #endif
+ }
+@@ -261,12 +261,12 @@
+ pflogstart(struct ifnet *ifp)
+ {
+ 	struct mbuf *m;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	int s;
+ #endif
+ 
+ 	for (;;) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		IF_LOCK(&ifp->if_snd);
+ 		_IF_DROP(&ifp->if_snd);
+ 		_IF_DEQUEUE(&ifp->if_snd, m);
+@@ -287,7 +287,7 @@
+ 
+ int
+ pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct route *rt)
+ #else
+ 	struct rtentry *rt)
+@@ -303,7 +303,7 @@
+ {
+ 	switch (cmd) {
+ 	case SIOCSIFFLAGS:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (ifp->if_flags & IFF_UP)
+ 			ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ 		else
+@@ -355,7 +355,7 @@
+ 			    sizeof(hdr.ruleset));
+ 	}
+ 	if (rm->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/*
+ 		 * XXX: This should not happen as we force an early lookup
+ 		 * via debug.pfugidhack
+@@ -387,7 +387,7 @@
+ 
+ 	ifn->if_opackets++;
+ 	ifn->if_obytes += m->m_pkthdr.len;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	BPF_MTAP2(ifn, &hdr, PFLOG_HDRLEN, m);
+ #else
+ 	bpf_mtap_hdr(ifn->if_bpf, (char *)&hdr, PFLOG_HDRLEN, m,
+@@ -398,7 +398,7 @@
+ 	return (0);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static int
+ pflog_modevent(module_t mod, int type, void *data)
+ {
+--- a/sys/contrib/pf/net/if_pfsync.c
++++ b/sys/contrib/pf/net/if_pfsync.c
+@@ -42,7 +42,7 @@
+  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ #include "opt_bpf.h"
+@@ -72,7 +72,7 @@
+ 
+ #include <sys/param.h>
+ #include <sys/kernel.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/bus.h>
+ #include <sys/interrupt.h>
+ #include <sys/priv.h>
+@@ -82,7 +82,7 @@
+ #include <sys/time.h>
+ #include <sys/mbuf.h>
+ #include <sys/socket.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/endian.h>
+ #include <sys/malloc.h>
+ #include <sys/module.h>
+@@ -95,19 +95,19 @@
+ #include <sys/timeout.h>
+ #endif
+ #include <sys/sysctl.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/pool.h>
+ #endif
+ 
+ #include <net/if.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <net/if_clone.h>
+ #endif
+ #include <net/if_types.h>
+ #include <net/route.h>
+ #include <net/bpf.h>
+ #include <net/netisr.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <net/vnet.h>
+ #endif
+ 
+@@ -127,7 +127,7 @@
+ #include <netinet6/nd6.h>
+ #endif /* INET6 */
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include "carp.h"
+ #endif
+ #if NCARP > 0
+@@ -137,7 +137,7 @@
+ #include <net/pfvar.h>
+ #include <net/if_pfsync.h>
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include "bpfilter.h"
+ #include "pfsync.h"
+ #endif
+@@ -222,7 +222,7 @@
+ 	TAILQ_ENTRY(pfsync_deferral)		 pd_entry;
+ 	struct pf_state				*pd_st;
+ 	struct mbuf				*pd_m;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct callout				 pd_tmo;
+ #else
+ 	struct timeout				 pd_tmo;
+@@ -238,14 +238,14 @@
+ #endif
+ 
+ struct pfsync_softc {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ifnet		*sc_ifp;
+ #else
+ 	struct ifnet		 sc_if;
+ #endif
+ 	struct ifnet		*sc_sync_if;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	uma_zone_t		 sc_pool;
+ #else
+ 	struct pool		 sc_pool;
+@@ -255,7 +255,7 @@
+ 
+ 	struct in_addr		 sc_sync_peer;
+ 	u_int8_t		 sc_maxupdates;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int			 pfsync_sync_ok;
+ #endif
+ 
+@@ -274,7 +274,7 @@
+ 
+ 	u_int32_t		 sc_ureq_sent;
+ 	int			 sc_bulk_tries;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct callout		 sc_bulkfail_tmo;
+ #else
+ 	struct timeout		 sc_bulkfail_tmo;
+@@ -283,7 +283,7 @@
+ 	u_int32_t		 sc_ureq_received;
+ 	struct pf_state		*sc_bulk_next;
+ 	struct pf_state		*sc_bulk_last;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct callout		 sc_bulk_tmo;
+ #else
+ 	struct timeout		 sc_bulk_tmo;
+@@ -291,18 +291,18 @@
+ 
+ 	TAILQ_HEAD(, tdb)	 sc_tdb_q;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct callout		 sc_tmo;
+ #else
+ 	struct timeout		 sc_tmo;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	eventhandler_tag	 sc_detachtag;
+ #endif
+ 
+ };
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static VNET_DEFINE(struct pfsync_softc	*, pfsyncif) = NULL;
+ #define	V_pfsyncif		VNET(pfsyncif)
+ 
+@@ -319,7 +319,7 @@
+ #define	V_pfsyncstats	 pfsyncstats
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static void	pfsyncintr(void *);
+ struct pfsync_swi {
+ 	void *	pfsync_swi_cookie;
+@@ -330,7 +330,7 @@
+ #endif
+ 
+ void	pfsyncattach(int);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int	pfsync_clone_create(struct if_clone *, int, caddr_t);
+ void	pfsync_clone_destroy(struct ifnet *);
+ #else
+@@ -341,7 +341,7 @@
+ 	    struct pf_state_peer *);
+ void	pfsync_update_net_tdb(struct pfsync_tdb *);
+ int	pfsyncoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	    struct route *);
+ #else
+ 	    struct rtentry *);
+@@ -373,7 +373,7 @@
+ void	pfsync_bulk_update(void *);
+ void	pfsync_bulk_fail(void *);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void	pfsync_ifdetach(void *, struct ifnet *);
+ 
+ /* XXX: ugly */
+@@ -382,11 +382,11 @@
+ #endif
+ 
+ #define PFSYNC_MAX_BULKTRIES	12
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ int	pfsync_sync_ok;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ IFC_SIMPLE_DECLARE(pfsync, 1);
+ #else
+ struct if_clone	pfsync_cloner =
+@@ -399,7 +399,7 @@
+ 	if_clone_attach(&pfsync_cloner);
+ }
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t param)
+ #else
+ pfsync_clone_create(struct if_clone *ifc, int unit)
+@@ -412,7 +412,7 @@
+ 	if (unit != 0)
+ 		return (EINVAL);
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	pfsync_sync_ok = 1;
+ #endif
+ 
+@@ -423,7 +423,7 @@
+ 	for (q = 0; q < PFSYNC_S_COUNT; q++)
+ 		TAILQ_INIT(&sc->sc_qs[q]);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sc->pfsync_sync_ok = 1;
+ 	sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE,
+ 			NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+@@ -443,7 +443,7 @@
+ 	sc->sc_len = PFSYNC_MINPKT;
+ 	sc->sc_maxupdates = 128;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sc->sc_imo.imo_membership = (struct in_multi **)malloc(
+ 	    (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_DEVBUF,
+ 	    M_NOWAIT | M_ZERO);
+@@ -456,7 +456,7 @@
+ 	sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC);
+ 	if (ifp == NULL) {
+ 		free(sc->sc_imo.imo_membership, M_DEVBUF);
+@@ -467,7 +467,7 @@
+ 	if_initname(ifp, ifc->ifc_name, unit);
+ 
+ 	sc->sc_detachtag = EVENTHANDLER_REGISTER(ifnet_departure_event,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	    pfsync_ifdetach, V_pfsyncif, EVENTHANDLER_PRI_ANY);
+ #else
+ 	    pfsync_ifdetach, pfsyncif, EVENTHANDLER_PRI_ANY);
+@@ -491,7 +491,7 @@
+ 	ifp->if_snd.ifq_maxlen = ifqmaxlen;
+ 	ifp->if_hdrlen = sizeof(struct pfsync_header);
+ 	ifp->if_mtu = 1500; /* XXX */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	callout_init(&sc->sc_tmo, CALLOUT_MPSAFE);
+ 	callout_init_mtx(&sc->sc_bulk_tmo, &pf_task_mtx, 0);
+ 	callout_init(&sc->sc_bulkfail_tmo, CALLOUT_MPSAFE);
+@@ -503,7 +503,7 @@
+ #endif
+ 
+ 	if_attach(ifp);
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	if_alloc_sadl(ifp);
+ #endif
+ 
+@@ -512,14 +512,14 @@
+ #endif
+ 
+ #if NBPFILTER > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	bpfattach(ifp, DLT_PFSYNC, PFSYNC_HDRLEN);
+ #else
+ 	bpfattach(&sc->sc_if.if_bpf, ifp, DLT_PFSYNC, PFSYNC_HDRLEN);
+ #endif
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfsyncif = sc;
+ #else
+ 	pfsyncif = sc;
+@@ -528,7 +528,7 @@
+ 	return (0);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ #else
+ int
+@@ -537,14 +537,14 @@
+ {
+ 	struct pfsync_softc *sc = ifp->if_softc;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag);
+ #endif
+ 	timeout_del(&sc->sc_bulk_tmo);	/* XXX: need PF_LOCK() before */
+ 	timeout_del(&sc->sc_tmo);
+ #if NCARP > 0
+ #ifdef notyet
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!sc->pfsync_sync_ok)
+ #else
+ 	if (!pfsync_sync_ok)
+@@ -562,12 +562,12 @@
+ 	while (sc->sc_deferred > 0)
+ 		pfsync_undefer(TAILQ_FIRST(&sc->sc_deferrals), 0);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	UMA_DESTROY(sc->sc_pool);
+ #else
+ 	pool_destroy(&sc->sc_pool);
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if_free(ifp);
+ 	free(sc->sc_imo.imo_membership, M_DEVBUF);
+ #else
+@@ -575,13 +575,13 @@
+ #endif
+ 	free(sc, M_DEVBUF);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfsyncif = NULL;
+ #else
+ 	pfsyncif = NULL;
+ #endif
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	return (0);
+ #endif
+ }
+@@ -590,11 +590,11 @@
+ pfsync_if_dequeue(struct ifnet *ifp)
+ {
+ 	struct mbuf *m;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	int s;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	IF_LOCK(&ifp->if_snd);
+ 	_IF_DROP(&ifp->if_snd);
+ 	_IF_DEQUEUE(&ifp->if_snd, m);
+@@ -617,7 +617,7 @@
+ 	struct mbuf *m;
+ 
+ 	while ((m = pfsync_if_dequeue(ifp)) != NULL) {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 		IF_DROP(&ifp->if_snd);
+ #endif
+ 		m_freem(m);
+@@ -629,7 +629,7 @@
+     struct pf_state_peer *d)
+ {
+ 	if (s->scrub.scrub_flag && d->scrub == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		d->scrub = pool_get(&V_pf_state_scrub_pl, PR_NOWAIT | PR_ZERO);
+ #else
+ 		d->scrub = pool_get(&pf_state_scrub_pl, PR_NOWAIT | PR_ZERO);
+@@ -641,7 +641,7 @@
+ 	return (0);
+ }
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ void
+ pfsync_state_export(struct pfsync_state *sp, struct pf_state *st)
+ {
+@@ -716,7 +716,7 @@
+ 
+ 	PF_LOCK_ASSERT();
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sp->creatorid == 0 && V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 	if (sp->creatorid == 0 && pf_status.debug >= PF_DEBUG_MISC) {
+@@ -727,7 +727,7 @@
+ 	}
+ 
+ 	if ((kif = pfi_kif_get(sp->ifname)) == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -749,7 +749,7 @@
+ 		r = pf_main_ruleset.rules[
+ 		    PF_RULESET_FILTER].active.ptr_array[ntohl(sp->rule)];
+ 	else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		r = &V_pf_default_rule;
+ #else
+ 		r = &pf_default_rule;
+@@ -758,7 +758,7 @@
+ 	if ((r->max_states && r->states_cur >= r->max_states))
+ 		goto cleanup;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (flags & PFSYNC_SI_IOCTL)
+ 		pool_flags = PR_WAITOK | PR_ZERO;
+ 	else
+@@ -856,7 +856,7 @@
+ 		CLR(st->state_flags, PFSTATE_NOSYNC);
+ 		if (ISSET(st->state_flags, PFSTATE_ACK)) {
+ 			pfsync_q_ins(st, PFSYNC_S_IACK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pfsync_sendout();
+ #else
+ 			schednetisr(NETISR_PFSYNC);
+@@ -871,7 +871,7 @@
+ 	error = ENOMEM;
+ 	if (skw == sks)
+ 		sks = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (skw != NULL)
+ 		pool_put(&V_pf_state_key_pl, skw);
+ 	if (sks != NULL)
+@@ -885,7 +885,7 @@
+ 
+ cleanup_state:	/* pf_state_insert frees the state keys */
+ 	if (st) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (st->dst.scrub)
+ 			pool_put(&V_pf_state_scrub_pl, st->dst.scrub);
+ 		if (st->src.scrub)
+@@ -903,13 +903,13 @@
+ }
+ 
+ void
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pfsync_input(struct mbuf *m, __unused int off)
+ #else
+ pfsync_input(struct mbuf *m, ...)
+ #endif
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -925,7 +925,7 @@
+ 	V_pfsyncstats.pfsyncs_ipackets++;
+ 
+ 	/* verify that we have a sync interface configured */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!sc || !sc->sc_sync_if || !V_pf_status.running)
+ #else
+ 	if (!sc || !sc->sc_sync_if || !pf_status.running)
+@@ -938,7 +938,7 @@
+ 		goto done;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sc->sc_ifp->if_ipackets++;
+ 	sc->sc_ifp->if_ibytes += m->m_pkthdr.len;
+ #else
+@@ -984,7 +984,7 @@
+ 	pkt.src = ip->ip_src;
+ 	pkt.flags = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!bcmp(&ph->pfcksum, &V_pf_status.pf_chksum, PF_MD5_DIGEST_LENGTH))
+ #else
+ 	if (!bcmp(&ph->pfcksum, &pf_status.pf_chksum, PF_MD5_DIGEST_LENGTH))
+@@ -1035,14 +1035,14 @@
+ 	clr = (struct pfsync_clr *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+ 		creatorid = clr[i].creatorid;
+ 
+ 		if (clr[i].ifname[0] == '\0') {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			for (st = RB_MIN(pf_state_tree_id, &V_tree_id);
+ 			    st; st = nexts) {
+ 				nexts = RB_NEXT(pf_state_tree_id, &V_tree_id, st);
+@@ -1061,14 +1061,14 @@
+ 				continue;
+ 
+ 			/* XXX correct? */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			for (sk = RB_MIN(pf_state_tree, &V_pf_statetbl);
+ #else
+ 			for (sk = RB_MIN(pf_state_tree, &pf_statetbl);
+ #endif
+ 			    sk; sk = nextsk) {
+ 				nextsk = RB_NEXT(pf_state_tree,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    &V_pf_statetbl, sk);
+ #else
+ 				    &pf_statetbl, sk);
+@@ -1083,7 +1083,7 @@
+ 			}
+ 		}
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1109,7 +1109,7 @@
+ 	sa = (struct pfsync_state *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1121,7 +1121,7 @@
+ 		    sp->dst.state > PF_TCPS_PROXY_DST ||
+ 		    sp->direction > PF_OUT ||
+ 		    (sp->af != AF_INET && sp->af != AF_INET6)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1138,7 +1138,7 @@
+ 			break;
+ 		}
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1166,7 +1166,7 @@
+ 	iaa = (struct pfsync_ins_ack *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1182,7 +1182,7 @@
+ 		if (ISSET(st->state_flags, PFSTATE_ACK))
+ 			pfsync_deferred(st, 0);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1250,7 +1250,7 @@
+ 	sa = (struct pfsync_state *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1260,7 +1260,7 @@
+ 		if (sp->timeout >= PFTM_MAX ||
+ 		    sp->src.state > PF_TCPS_PROXY_DST ||
+ 		    sp->dst.state > PF_TCPS_PROXY_DST) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1302,7 +1302,7 @@
+ 		}
+ 
+ 		if (sfail) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1316,7 +1316,7 @@
+ 			V_pfsyncstats.pfsyncs_stale++;
+ 
+ 			pfsync_update_state(st);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pfsync_sendout();
+ #else
+ 			schednetisr(NETISR_PFSYNC);
+@@ -1330,7 +1330,7 @@
+ 		st->timeout = sp->timeout;
+ 		st->pfsync_time = time_second;
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1361,7 +1361,7 @@
+ 	ua = (struct pfsync_upd_c *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1371,7 +1371,7 @@
+ 		if (up->timeout >= PFTM_MAX ||
+ 		    up->src.state > PF_TCPS_PROXY_DST ||
+ 		    up->dst.state > PF_TCPS_PROXY_DST) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1412,7 +1412,7 @@
+ 		}
+ 
+ 		if (sfail) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1426,7 +1426,7 @@
+ 			V_pfsyncstats.pfsyncs_stale++;
+ 
+ 			pfsync_update_state(st);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pfsync_sendout();
+ #else
+ 			schednetisr(NETISR_PFSYNC);
+@@ -1440,7 +1440,7 @@
+ 		st->timeout = up->timeout;
+ 		st->pfsync_time = time_second;
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1511,7 +1511,7 @@
+ 	sa = (struct pfsync_state *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1528,7 +1528,7 @@
+ 		SET(st->state_flags, PFSTATE_NOSYNC);
+ 		pf_unlink_state(st);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1555,7 +1555,7 @@
+ 	sa = (struct pfsync_del_c *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++) {
+@@ -1573,7 +1573,7 @@
+ 		SET(st->state_flags, PFSTATE_NOSYNC);
+ 		pf_unlink_state(st);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1584,7 +1584,7 @@
+ int
+ pfsync_in_bus(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -1607,7 +1607,7 @@
+ 
+ 	switch (bus->status) {
+ 	case PFSYNC_BUS_START:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		callout_reset(&sc->sc_bulkfail_tmo, 5 * hz, pfsync_bulk_fail,
+ 		    V_pfsyncif);
+ #else
+@@ -1617,7 +1617,7 @@
+ 		    pf_pool_limits[PF_LIMIT_STATES].limit /
+ 		    (PFSYNC_BULKPACKETS * sc->sc_maxcount));
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -1634,7 +1634,7 @@
+ 			timeout_del(&sc->sc_bulkfail_tmo);
+ #if NCARP > 0
+ #ifdef notyet
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (!sc->pfsync_sync_ok)
+ #else
+ 			if (!pfsync_sync_ok)
+@@ -1642,12 +1642,12 @@
+ 				carp_group_demote_adj(&sc->sc_if, -1);
+ #endif
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			sc->pfsync_sync_ok = 1;
+ #else
+ 			pfsync_sync_ok = 1;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -1655,7 +1655,7 @@
+ 				printf("pfsync: received valid "
+ 				    "bulk update end\n");
+ 		} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -1689,12 +1689,12 @@
+ 	tp = (struct pfsync_tdb *)(mp->m_data + offp);
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	for (i = 0; i < count; i++)
+ 		pfsync_update_net_tdb(&tp[i]);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+@@ -1737,7 +1737,7 @@
+ 	return;
+ 
+ bad:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 	if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -1773,7 +1773,7 @@
+ 
+ int
+ pfsyncoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct route *rt)
+ #else
+ 	struct rtentry *rt)
+@@ -1787,7 +1787,7 @@
+ int
+ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
+ {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	struct proc *p = curproc;
+ #endif
+ 	struct pfsync_softc *sc = ifp->if_softc;
+@@ -1805,7 +1805,7 @@
+ 	case SIOCSIFDSTADDR:
+ #endif
+ 	case SIOCSIFFLAGS:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (ifp->if_flags & IFF_UP)
+ 			ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ 		else
+@@ -1824,11 +1824,11 @@
+ 			ifr->ifr_mtu = MCLBYTES;
+ 		if (ifr->ifr_mtu < ifp->if_mtu) {
+ 			s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_LOCK();
+ #endif
+ 			pfsync_sendout();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ #endif
+ 			splx(s);
+@@ -1846,7 +1846,7 @@
+ 		return (copyout(&pfsyncr, ifr->ifr_data, sizeof(pfsyncr)));
+ 
+ 	case SIOCSETPFSYNC:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((error = priv_check(curthread, PRIV_NETINET_PF)) != 0)
+ #else
+ 		if ((error = suser(p, p->p_acflag)) != 0)
+@@ -1855,11 +1855,11 @@
+ 		if ((error = copyin(ifr->ifr_data, &pfsyncr, sizeof(pfsyncr))))
+ 			return (error);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		if (pfsyncr.pfsyncr_syncpeer.s_addr == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			sc->sc_sync_peer.s_addr = htonl(INADDR_PFSYNC_GROUP);
+ #else
+ 			sc->sc_sync_peer.s_addr = INADDR_PFSYNC_GROUP;
+@@ -1869,19 +1869,19 @@
+ 			    pfsyncr.pfsyncr_syncpeer.s_addr;
+ 
+ 		if (pfsyncr.pfsyncr_maxupdates > 255)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		{
+ 			PF_UNLOCK();
+ #endif
+ 			return (EINVAL);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		}
+ #endif
+ 		sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
+ 
+ 		if (pfsyncr.pfsyncr_syncdev[0] == 0) {
+ 			sc->sc_sync_if = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ #endif
+ 			if (imo->imo_num_memberships > 0) {
+@@ -1892,17 +1892,17 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		if ((sifp = ifunit(pfsyncr.pfsyncr_syncdev)) == NULL)
+ 			return (EINVAL);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (sifp->if_mtu < sc->sc_ifp->if_mtu ||
+ #else
+ 		if (sifp->if_mtu < sc->sc_if.if_mtu ||
+@@ -1914,18 +1914,18 @@
+ 		sc->sc_sync_if = sifp;
+ 
+ 		if (imo->imo_num_memberships > 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ #endif
+ 			in_delmulti(imo->imo_membership[--imo->imo_num_memberships]);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_LOCK();
+ #endif
+ 			imo->imo_multicast_ifp = NULL;
+ 		}
+ 
+ 		if (sc->sc_sync_if &&
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    sc->sc_sync_peer.s_addr == htonl(INADDR_PFSYNC_GROUP)) {
+ #else
+ 		    sc->sc_sync_peer.s_addr == INADDR_PFSYNC_GROUP) {
+@@ -1934,20 +1934,20 @@
+ 
+ 			if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) {
+ 				sc->sc_sync_if = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				PF_UNLOCK();
+ #endif
+ 				splx(s);
+ 				return (EADDRNOTAVAIL);
+ 			}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			addr.s_addr = htonl(INADDR_PFSYNC_GROUP);
+ #else
+ 			addr.s_addr = INADDR_PFSYNC_GROUP;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ #endif
+ 			if ((imo->imo_membership[0] =
+@@ -1956,7 +1956,7 @@
+ 				splx(s);
+ 				return (ENOBUFS);
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_LOCK();
+ #endif
+ 			imo->imo_num_memberships++;
+@@ -1971,7 +1971,7 @@
+ 		ip->ip_hl = sizeof(sc->sc_template) >> 2;
+ 		ip->ip_tos = IPTOS_LOWDELAY;
+ 		/* len and id are set later */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		ip->ip_off = IP_DF;
+ #else
+ 		ip->ip_off = htons(IP_DF);
+@@ -1986,7 +1986,7 @@
+ 			sc->sc_ureq_sent = time_uptime;
+ #if NCARP > 0
+ #ifdef notyet
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (sc->pfsync_sync_ok)
+ #else
+ 			if (pfsync_sync_ok)
+@@ -1994,18 +1994,18 @@
+ 				carp_group_demote_adj(&sc->sc_if, 1);
+ #endif
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			sc->pfsync_sync_ok = 0;
+ #else
+ 			pfsync_sync_ok = 0;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC)
+ #endif
+ 				printf("pfsync: requesting bulk update\n");
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			callout_reset(&sc->sc_bulkfail_tmo, 5 * hz,
+ 			    pfsync_bulk_fail, V_pfsyncif);
+ #else
+@@ -2013,7 +2013,7 @@
+ #endif
+ 			pfsync_request_update(0, 0);
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		splx(s);
+@@ -2100,7 +2100,7 @@
+ 
+ 		TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) {
+ #ifdef PFSYNC_DEBUG
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			KASSERT(st->sync_state == q,
+ 				("%s: st->sync_state == q", 
+ 					__FUNCTION__));
+@@ -2135,13 +2135,13 @@
+ void
+ pfsync_sendout(void)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ #if NBPFILTER > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ifnet *ifp = sc->sc_ifp;
+ #else
+ 	struct ifnet *ifp = &sc->sc_if;
+@@ -2156,14 +2156,14 @@
+ #ifdef notyet
+ 	struct tdb *t;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	size_t pktlen;
+ 	int dummy_error;
+ #endif
+ 	int offset;
+ 	int q, count = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_NET);
+@@ -2183,7 +2183,7 @@
+ 
+ 	MGETHDR(m, M_DONTWAIT, MT_DATA);
+ 	if (m == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		sc->sc_ifp->if_oerrors++;
+ #else
+ 		sc->sc_if.if_oerrors++;
+@@ -2193,7 +2193,7 @@
+ 		return;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pktlen = max_linkhdr + sc->sc_len;
+ 	if (pktlen > MHLEN) {
+ 		/* Find the right pool to allocate from. */
+@@ -2210,7 +2210,7 @@
+ #endif
+ 		if (!ISSET(m->m_flags, M_EXT)) {
+ 			m_free(m);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			sc->sc_ifp->if_oerrors++;
+ #else
+ 			sc->sc_if.if_oerrors++;
+@@ -2228,7 +2228,7 @@
+ 	bcopy(&sc->sc_template, ip, sizeof(*ip));
+ 	offset = sizeof(*ip);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	ip->ip_len = m->m_pkthdr.len;
+ #else
+ 	ip->ip_len = htons(m->m_pkthdr.len);
+@@ -2242,7 +2242,7 @@
+ 
+ 	ph->version = PFSYNC_VERSION;
+ 	ph->len = htons(sc->sc_len - sizeof(*ip));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	bcopy(V_pf_status.pf_chksum, ph->pfcksum, PF_MD5_DIGEST_LENGTH);
+ #else
+ 	bcopy(pf_status.pf_chksum, ph->pfcksum, PF_MD5_DIGEST_LENGTH);
+@@ -2259,7 +2259,7 @@
+ 		count = 0;
+ 		TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) {
+ #ifdef PFSYNC_DEBUG
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			KASSERT(st->sync_state == q,
+ 				("%s: st->sync_state == q",
+ 					__FUNCTION__));
+@@ -2343,7 +2343,7 @@
+ 	if (ifp->if_bpf) {
+ 		m->m_data += sizeof(*ip);
+ 		m->m_len = m->m_pkthdr.len = sc->sc_len - sizeof(*ip);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		BPF_MTAP(ifp, m);
+ #else
+ 		bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
+@@ -2359,7 +2359,7 @@
+ 	}
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sc->sc_ifp->if_opackets++;
+ 	sc->sc_ifp->if_obytes += m->m_pkthdr.len;
+ 	sc->sc_len = PFSYNC_MINPKT;
+@@ -2383,13 +2383,13 @@
+ void
+ pfsync_insert_state(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2405,7 +2405,7 @@
+ 		return;
+ 
+ #ifdef PFSYNC_DEBUG
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(st->sync_state == PFSYNC_S_NONE,
+ 		("%s: st->sync_state == PFSYNC_S_NONE", __FUNCTION__));
+ #else
+@@ -2414,7 +2414,7 @@
+ #endif
+ 
+ 	if (sc->sc_len == PFSYNC_MINPKT)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout,
+ 		    V_pfsyncif);
+ #else
+@@ -2424,7 +2424,7 @@
+ 	pfsync_q_ins(st, PFSYNC_S_INS);
+ 
+ 	if (ISSET(st->state_flags, PFSTATE_ACK))
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pfsync_sendout();
+ #else
+ 		schednetisr(NETISR_PFSYNC);
+@@ -2438,14 +2438,14 @@
+ int
+ pfsync_defer(struct pf_state *st, struct mbuf *m)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 	struct pfsync_deferral *pd;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2459,7 +2459,7 @@
+ 		return (0);
+ 	sc->sc_deferred++;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	m->m_flags |= M_SKIP_FIREWALL;
+ #else
+ 	m->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
+@@ -2470,7 +2470,7 @@
+ 	pd->pd_m = m;
+ 
+ 	TAILQ_INSERT_TAIL(&sc->sc_deferrals, pd, pd_entry);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	callout_init(&pd->pd_tmo, CALLOUT_MPSAFE);
+ 	callout_reset(&pd->pd_tmo, defer, pfsync_defer_tmo,
+ 		pd);
+@@ -2485,14 +2485,14 @@
+ void
+ pfsync_undefer(struct pfsync_deferral *pd, int drop)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 	int s;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2507,13 +2507,13 @@
+ 		m_freem(pd->pd_m);
+ 	else {
+ 		s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/* XXX: use pf_defered?! */
+ 		PF_UNLOCK();
+ #endif
+ 		ip_output(pd->pd_m, (void *)NULL, (void *)NULL, 0,
+ 		    (void *)NULL, (void *)NULL);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		splx(s);
+@@ -2525,18 +2525,18 @@
+ void
+ pfsync_defer_tmo(void *arg)
+ {
+-#if defined(__FreeBSD__) && defined(VIMAGE)
++#if defined(__FreeBSD_kernel__) && defined(VIMAGE)
+ 	struct pfsync_deferral *pd = arg;
+ #endif
+ 	int s;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_SET(pd->pd_m->m_pkthdr.rcvif->if_vnet); /* XXX */
+ 	PF_LOCK();
+ #endif
+ 	pfsync_undefer(arg, 0);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ 	CURVNET_RESTORE();
+ #endif
+@@ -2546,7 +2546,7 @@
+ void
+ pfsync_deferred(struct pf_state *st, int drop)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2568,14 +2568,14 @@
+ void
+ pfsync_update_state(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 	int sync = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2593,7 +2593,7 @@
+ 	}
+ 
+ 	if (sc->sc_len == PFSYNC_MINPKT)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout,
+ 		    V_pfsyncif);
+ #else
+@@ -2625,7 +2625,7 @@
+ 
+ 	if (sync || (time_second - st->pfsync_time) < 2) {
+ 		pfsync_upds++;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pfsync_sendout();
+ #else
+ 		schednetisr(NETISR_PFSYNC);
+@@ -2636,7 +2636,7 @@
+ void
+ pfsync_request_update(u_int32_t creatorid, u_int64_t id)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2664,7 +2664,7 @@
+ 	if (TAILQ_EMPTY(&sc->sc_upd_req_list))
+ 		nlen += sizeof(struct pfsync_subheader);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sc->sc_len + nlen > sc->sc_ifp->if_mtu) {
+ #else
+ 	if (sc->sc_len + nlen > sc->sc_if.if_mtu) {
+@@ -2680,7 +2680,7 @@
+ 	TAILQ_INSERT_TAIL(&sc->sc_upd_req_list, item, ur_entry);
+ 	sc->sc_len += nlen;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pfsync_sendout();
+ #else
+ 	schednetisr(NETISR_PFSYNC);
+@@ -2690,7 +2690,7 @@
+ void
+ pfsync_update_state_req(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2713,7 +2713,7 @@
+ 		pfsync_q_del(st);
+ 	case PFSYNC_S_NONE:
+ 		pfsync_q_ins(st, PFSYNC_S_UPD);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pfsync_sendout();
+ #else
+ 		schednetisr(NETISR_PFSYNC);
+@@ -2735,13 +2735,13 @@
+ void
+ pfsync_delete_state(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2759,7 +2759,7 @@
+ 	}
+ 
+ 	if (sc->sc_len == PFSYNC_MINPKT)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout,
+ 		    V_pfsyncif);
+ #else
+@@ -2796,13 +2796,13 @@
+ 		struct pfsync_clr clr;
+ 	} __packed r;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #else
+ 	splassert(IPL_SOFTNET);
+@@ -2825,7 +2825,7 @@
+ void
+ pfsync_q_ins(struct pf_state *st, int q)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2835,7 +2835,7 @@
+ 
+ 	PF_LOCK_ASSERT();
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(st->sync_state == PFSYNC_S_NONE,
+ 		("%s: st->sync_state == PFSYNC_S_NONE", __FUNCTION__));
+ #else
+@@ -2844,7 +2844,7 @@
+ 
+ #if 1 || defined(PFSYNC_DEBUG)
+ 	if (sc->sc_len < PFSYNC_MINPKT)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		panic("pfsync pkt len is too low %zu", sc->sc_len);
+ #else
+ 		panic("pfsync pkt len is too low %d", sc->sc_len);
+@@ -2853,7 +2853,7 @@
+ 	if (TAILQ_EMPTY(&sc->sc_qs[q]))
+ 		nlen += sizeof(struct pfsync_subheader);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sc->sc_len + nlen > sc->sc_ifp->if_mtu) {
+ #else
+ 	if (sc->sc_len + nlen > sc->sc_if.if_mtu) {
+@@ -2873,14 +2873,14 @@
+ void
+ pfsync_q_del(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 	int q = st->sync_state;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(st->sync_state != PFSYNC_S_NONE, 
+ 		("%s: st->sync_state != PFSYNC_S_NONE", __FUNCTION__));
+ #else
+@@ -2899,7 +2899,7 @@
+ void
+ pfsync_update_tdb(struct tdb *t, int output)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2943,7 +2943,7 @@
+ void
+ pfsync_delete_tdb(struct tdb *t)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -2998,20 +2998,20 @@
+ void
+ pfsync_bulk_start(void)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 	if (pf_status.debug >= PF_DEBUG_MISC)
+ #endif
+ 		printf("pfsync: received bulk update request\n");
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ 	if (TAILQ_EMPTY(&V_state_list))
+ #else
+@@ -3021,7 +3021,7 @@
+ 	else {
+ 		sc->sc_ureq_received = time_uptime;
+ 		if (sc->sc_bulk_next == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			sc->sc_bulk_next = TAILQ_FIRST(&V_state_list);
+ #else
+ 			sc->sc_bulk_next = TAILQ_FIRST(&state_list);
+@@ -3032,7 +3032,7 @@
+ 			callout_reset(&sc->sc_bulk_tmo, 1,
+ 			    pfsync_bulk_update, sc);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ }
+@@ -3048,7 +3048,7 @@
+ 	PF_LOCK_ASSERT();
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_SET(sc->sc_ifp->if_vnet);
+ #endif
+ 	for (;;) {
+@@ -3061,7 +3061,7 @@
+ 
+ 		st = TAILQ_NEXT(st, entry_list);
+ 		if (st == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			st = TAILQ_FIRST(&V_state_list);
+ #else
+ 			st = TAILQ_FIRST(&state_list);
+@@ -3075,7 +3075,7 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (i > 1 && (sc->sc_ifp->if_mtu - sc->sc_len) <
+ #else
+ 		if (i > 1 && (sc->sc_if.if_mtu - sc->sc_len) <
+@@ -3083,7 +3083,7 @@
+ 		    sizeof(struct pfsync_state)) {
+ 			/* we've filled a packet */
+ 			sc->sc_bulk_next = st;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			callout_reset(&sc->sc_bulk_tmo, 1,
+ 			    pfsync_bulk_update, sc);
+ #else
+@@ -3093,7 +3093,7 @@
+ 		}
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_RESTORE();
+ #endif
+ 	splx(s);
+@@ -3107,7 +3107,7 @@
+ 		struct pfsync_bus bus;
+ 	} __packed r;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -3120,7 +3120,7 @@
+ 	r.subh.action = PFSYNC_ACT_BUS;
+ 	r.subh.count = htons(1);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	r.bus.creatorid = V_pf_status.hostid;
+ #else
+ 	r.bus.creatorid = pf_status.hostid;
+@@ -3136,13 +3136,13 @@
+ {
+ 	struct pfsync_softc *sc = arg;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_SET(sc->sc_ifp->if_vnet);
+ #endif
+ 
+ 	if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) {
+ 		/* Try again */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		callout_reset(&sc->sc_bulkfail_tmo, 5 * hz,
+ 		    pfsync_bulk_fail, V_pfsyncif);
+ #else
+@@ -3157,7 +3157,7 @@
+ 		sc->sc_bulk_tries = 0;
+ #if NCARP > 0
+ #ifdef notyet
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (!sc->pfsync_sync_ok)
+ #else
+ 		if (!pfsync_sync_ok)
+@@ -3165,12 +3165,12 @@
+ 			carp_group_demote_adj(&sc->sc_if, -1);
+ #endif
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		sc->pfsync_sync_ok = 1;
+ #else
+ 		pfsync_sync_ok = 1;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -3178,7 +3178,7 @@
+ 			printf("pfsync: failed to receive bulk update\n");
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_RESTORE();
+ #endif
+ }
+@@ -3186,7 +3186,7 @@
+ void
+ pfsync_send_plus(void *plus, size_t pluslen)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -3195,7 +3195,7 @@
+ 
+ 	PF_LOCK_ASSERT();
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sc->sc_len + pluslen > sc->sc_ifp->if_mtu) {
+ #else
+ 	if (sc->sc_len + pluslen > sc->sc_if.if_mtu) {
+@@ -3216,13 +3216,13 @@
+ int
+ pfsync_up(void)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sc == NULL || !ISSET(sc->sc_ifp->if_flags, IFF_DRV_RUNNING))
+ #else
+ 	if (sc == NULL || !ISSET(sc->sc_if.if_flags, IFF_RUNNING))
+@@ -3235,7 +3235,7 @@
+ int
+ pfsync_state_in_use(struct pf_state *st)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfsync_softc *sc = V_pfsyncif;
+ #else
+ 	struct pfsync_softc *sc = pfsyncif;
+@@ -3258,35 +3258,35 @@
+ void
+ pfsync_timeout(void *arg)
+ {
+-#if defined(__FreeBSD__) && defined(VIMAGE)
++#if defined(__FreeBSD_kernel__) && defined(VIMAGE)
+ 	struct pfsync_softc *sc = arg;
+ #endif
+ 	int s;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_SET(sc->sc_ifp->if_vnet);
+ #endif
+ 
+ 	pfsync_tmos++;
+ 
+ 	s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #endif
+ 	pfsync_sendout();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	splx(s);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	CURVNET_RESTORE();
+ #endif
+ }
+ 
+ /* this is a softnet/netisr handler */
+ void
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pfsyncintr(void *arg)
+ {
+ 	struct pfsync_softc *sc = arg;
+@@ -3342,7 +3342,7 @@
+ 	return (ENOPROTOOPT);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ pfsync_ifdetach(void *arg, struct ifnet *ifp)
+ {
+@@ -3449,12 +3449,12 @@
+ 
+ 	switch (type) {
+ 	case MOD_LOAD:
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 		pfsyncattach(0);
+ #endif
+ 		break;
+ 	case MOD_UNLOAD:
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 		if_clone_detach(&pfsync_cloner);
+ #endif
+ 		break;
+--- a/sys/contrib/pf/net/pf.c
++++ b/sys/contrib/pf/net/pf.c
+@@ -35,7 +35,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ 
+@@ -43,7 +43,7 @@
+ __FBSDID("$FreeBSD$");
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_bpf.h"
+ #include "opt_pf.h"
+ 
+@@ -86,7 +86,7 @@
+ #include <sys/socketvar.h>
+ #include <sys/kernel.h>
+ #include <sys/time.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/random.h>
+ #include <sys/sysctl.h>
+ #include <sys/endian.h>
+@@ -95,7 +95,7 @@
+ #include <sys/pool.h>
+ #endif
+ #include <sys/proc.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/kthread.h>
+ #include <sys/lock.h>
+ #include <sys/sx.h>
+@@ -103,7 +103,7 @@
+ #include <sys/rwlock.h>
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/md5.h>
+ #else
+ #include <crypto/md5.h>
+@@ -113,7 +113,7 @@
+ #include <net/if_types.h>
+ #include <net/bpf.h>
+ #include <net/route.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RADIX_MPATH
+ #include <net/radix_mpath.h>
+ #endif
+@@ -136,12 +136,12 @@
+ #include <netinet/udp_var.h>
+ #include <netinet/icmp_var.h>
+ #include <netinet/if_ether.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <netinet/ip_fw.h>
+ #include <netinet/ipfw/ip_fw_private.h> /* XXX: only for DIR_IN/DIR_OUT */
+ #endif
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <dev/rndvar.h>
+ #endif
+ #include <net/pfvar.h>
+@@ -154,13 +154,13 @@
+ #include <netinet/in_pcb.h>
+ #include <netinet/icmp6.h>
+ #include <netinet6/nd6.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <netinet6/ip6_var.h>
+ #include <netinet6/in6_pcb.h>
+ #endif
+ #endif /* INET6 */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <machine/in_cksum.h>
+ #include <sys/limits.h>
+ #include <sys/ucred.h>
+@@ -169,7 +169,7 @@
+ extern int ip_optcopy(struct ip *, struct ip *);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	DPFPRINTF(n, x)	if (V_pf_status.debug >= (n)) printf x
+ #else
+ #define	DPFPRINTF(n, x)	if (pf_status.debug >= (n)) printf x
+@@ -180,7 +180,7 @@
+  */
+ 
+ /* state tables */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(struct pf_state_tree,	 pf_statetbl);
+ 
+ VNET_DEFINE(struct pf_altqqueue,	 pf_altqs[2]);
+@@ -268,7 +268,7 @@
+ 			    struct pf_addr *, struct pf_addr *, u_int16_t,
+ 			    u_int16_t *, u_int16_t *, u_int16_t *,
+ 			    u_int16_t *, u_int8_t, sa_family_t);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void			 pf_send_tcp(struct mbuf *,
+ 			    const struct pf_rule *, sa_family_t,
+ #else
+@@ -286,7 +286,7 @@
+ int			 pf_test_rule(struct pf_rule **, struct pf_state **,
+ 			    int, struct pfi_kif *, struct mbuf *, int,
+ 			    void *, struct pf_pdesc *, struct pf_rule **,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    struct pf_ruleset **, struct ifqueue *,
+ 			    struct inpcb *);
+ #else
+@@ -328,7 +328,7 @@
+ void			 pf_route6(struct mbuf **, struct pf_rule *, int,
+ 			    struct ifnet *, struct pf_state *,
+ 			    struct pf_pdesc *);
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ int			 pf_socket_lookup(int, struct pf_pdesc *);
+ #endif
+ u_int8_t		 pf_get_wscale(struct mbuf *, int, u_int16_t,
+@@ -341,7 +341,7 @@
+ 			    struct pf_addr *);
+ int			 pf_check_proto_cksum(struct mbuf *, int, int,
+ 			    u_int8_t, sa_family_t);
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ struct pf_divert	*pf_get_divert(struct mbuf *);
+ #endif
+ void			 pf_print_state_parts(struct pf_state *,
+@@ -350,7 +350,7 @@
+ 			    struct pf_addr_wrap *);
+ int			 pf_compare_state_keys(struct pf_state_key *,
+ 			    struct pf_state_key *, struct pfi_kif *, u_int);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ struct pf_state		*pf_find_state(struct pfi_kif *,
+ 			    struct pf_state_key_cmp *, u_int, struct mbuf *,
+ 			    struct pf_mtag *);
+@@ -361,7 +361,7 @@
+ int			 pf_src_connlimit(struct pf_state **);
+ int			 pf_check_congestion(struct ifqueue *);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len);
+ 
+ VNET_DECLARE(int, pf_end_threads);
+@@ -380,7 +380,7 @@
+ };
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	PPACKET_LOOPED()						\
+ 	(pd->pf_mtag->flags & PF_PACKET_LOOPED)
+ 
+@@ -420,7 +420,7 @@
+ 	} while (0)
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	BOUND_IFACE(r, k) \
+ 	((r)->rule_flag & PFRULE_IFBOUND) ? (k) : V_pfi_all
+ #else
+@@ -457,7 +457,7 @@
+ static __inline int pf_state_compare_id(struct pf_state *,
+ 	struct pf_state *);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(struct pf_src_tree,	 	 tree_src_tracking);
+ 
+ VNET_DEFINE(struct pf_state_tree_id,	 tree_id);
+@@ -580,7 +580,7 @@
+ 	if ((*state)->rule.ptr->max_src_conn &&
+ 	    (*state)->rule.ptr->max_src_conn <
+ 	    (*state)->src_node->conn) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.lcounters[LCNT_SRCCONN]++;
+ #else
+ 		pf_status.lcounters[LCNT_SRCCONN]++;
+@@ -590,7 +590,7 @@
+ 
+ 	if ((*state)->rule.ptr->max_src_conn_rate.limit &&
+ 	    pf_check_threshold(&(*state)->src_node->conn_rate)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.lcounters[LCNT_SRCCONNRATE]++;
+ #else
+ 		pf_status.lcounters[LCNT_SRCCONNRATE]++;
+@@ -605,7 +605,7 @@
+ 		struct pfr_addr p;
+ 		u_int32_t	killed = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++;
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+@@ -642,7 +642,7 @@
+ 			struct pf_state_key *sk;
+ 			struct pf_state *st;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++;
+ 			RB_FOREACH(st, pf_state_tree_id, &V_tree_id) {
+ #else
+@@ -672,14 +672,14 @@
+ 					killed++;
+ 				}
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC)
+ #endif
+ 				printf(", %u states killed", killed);
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC)
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC)
+@@ -707,7 +707,7 @@
+ 			k.rule.ptr = rule;
+ 		else
+ 			k.rule.ptr = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.scounters[SCNT_SRC_NODE_SEARCH]++;
+ 		*sn = RB_FIND(pf_src_tree, &V_tree_src_tracking, &k);
+ #else
+@@ -718,13 +718,13 @@
+ 	if (*sn == NULL) {
+ 		if (!rule->max_src_nodes ||
+ 		    rule->src_nodes < rule->max_src_nodes)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			(*sn) = pool_get(&V_pf_src_tree_pl, PR_NOWAIT | PR_ZERO);
+ #else
+ 			(*sn) = pool_get(&pf_src_tree_pl, PR_NOWAIT | PR_ZERO);
+ #endif
+ 		else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_status.lcounters[LCNT_SRCNODES]++;
+ #else
+ 			pf_status.lcounters[LCNT_SRCNODES]++;
+@@ -744,7 +744,7 @@
+ 			(*sn)->rule.ptr = NULL;
+ 		PF_ACPY(&(*sn)->addr, src, af);
+ 		if (RB_INSERT(pf_src_tree,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    &V_tree_src_tracking, *sn) != NULL) {
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+@@ -755,7 +755,7 @@
+ 				pf_print_host(&(*sn)->addr, 0, af);
+ 				printf("\n");
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_src_tree_pl, *sn);
+ #else
+ 			pool_put(&pf_src_tree_pl, *sn);
+@@ -766,7 +766,7 @@
+ 		(*sn)->ruletype = rule->action;
+ 		if ((*sn)->rule.ptr != NULL)
+ 			(*sn)->rule.ptr->src_nodes++;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.scounters[SCNT_SRC_NODE_INSERT]++;
+ 		V_pf_status.src_nodes++;
+ #else
+@@ -776,7 +776,7 @@
+ 	} else {
+ 		if (rule->max_src_states &&
+ 		    (*sn)->states >= rule->max_src_states) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_status.lcounters[LCNT_SRCSTATES]++;
+ #else
+ 			pf_status.lcounters[LCNT_SRCSTATES]++;
+@@ -879,13 +879,13 @@
+ 	struct pf_state_key	*cur;
+ 	struct pf_state		*olds = NULL;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(s->key[idx] == NULL, ("%s: key is null!", __FUNCTION__));
+ #else
+ 	KASSERT(s->key[idx] == NULL);	/* XXX handle this? */
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((cur = RB_INSERT(pf_state_tree, &V_pf_statetbl, sk)) != NULL) {
+ #else
+ 	if ((cur = RB_INSERT(pf_state_tree, &pf_statetbl, sk)) != NULL) {
+@@ -902,7 +902,7 @@
+ 					/* unlink late or sks can go away */
+ 					olds = si->s;
+ 				} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 					if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -925,7 +925,7 @@
+ 						    sk : NULL);
+ 						printf("\n");
+ 					}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					pool_put(&V_pf_state_key_pl, sk);
+ #else
+ 					pool_put(&pf_state_key_pl, sk);
+@@ -933,7 +933,7 @@
+ 					return (-1);	/* collision! */
+ 				}
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_state_key_pl, sk);
+ #else
+ 		pool_put(&pf_state_key_pl, sk);
+@@ -942,7 +942,7 @@
+ 	} else
+ 		s->key[idx] = sk;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((si = pool_get(&V_pf_state_item_pl, PR_NOWAIT)) == NULL) {
+ #else
+ 	if ((si = pool_get(&pf_state_item_pl, PR_NOWAIT)) == NULL) {
+@@ -953,7 +953,7 @@
+ 	si->s = s;
+ 
+ 	/* list is sorted, if-bound states before floating */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (s->kif == V_pfi_all)
+ #else
+ 	if (s->kif == pfi_all)
+@@ -992,7 +992,7 @@
+ 
+ 	if (si) {
+ 		TAILQ_REMOVE(&s->key[idx]->states, si, entry);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_state_item_pl, si);
+ #else
+ 		pool_put(&pf_state_item_pl, si);
+@@ -1000,20 +1000,20 @@
+ 	}
+ 
+ 	if (TAILQ_EMPTY(&s->key[idx]->states)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_state_tree, &V_pf_statetbl, s->key[idx]);
+ #else
+ 		RB_REMOVE(pf_state_tree, &pf_statetbl, s->key[idx]);
+ #endif
+ 		if (s->key[idx]->reverse)
+ 			s->key[idx]->reverse->reverse = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX: implement this */
+ #else
+ 		if (s->key[idx]->inp)
+ 			s->key[idx]->inp->inp_pf_sk = NULL;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_state_key_pl, s->key[idx]);
+ #else
+ 		pool_put(&pf_state_key_pl, s->key[idx]);
+@@ -1027,7 +1027,7 @@
+ {
+ 	struct pf_state_key	*sk;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((sk = pool_get(&V_pf_state_key_pl, pool_flags)) == NULL)
+ #else
+ 	if ((sk = pool_get(&pf_state_key_pl, pool_flags)) == NULL)
+@@ -1045,7 +1045,7 @@
+ 	struct pf_addr *saddr, struct pf_addr *daddr,
+ 	u_int16_t sport, u_int16_t dport)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((*skp == NULL && *nkp == NULL),
+ 		("%s: skp == NULL && nkp == NULL", __FUNCTION__));
+ #else
+@@ -1091,7 +1091,7 @@
+ pf_state_insert(struct pfi_kif *kif, struct pf_state_key *skw,
+     struct pf_state_key *sks, struct pf_state *s)
+ {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	splassert(IPL_SOFTNET);
+ #endif
+ 
+@@ -1103,7 +1103,7 @@
+ 		s->key[PF_SK_STACK] = s->key[PF_SK_WIRE];
+ 	} else {
+ 		if (pf_state_key_attach(skw, s, PF_SK_WIRE)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_state_key_pl, sks);
+ #else
+ 			pool_put(&pf_state_key_pl, sks);
+@@ -1117,7 +1117,7 @@
+ 	}
+ 
+ 	if (s->id == 0 && s->creatorid == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		s->id = htobe64(V_pf_status.stateid++);
+ 		s->creatorid = V_pf_status.hostid;
+ #else
+@@ -1125,7 +1125,7 @@
+ 		s->creatorid = pf_status.hostid;
+ #endif
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (RB_INSERT(pf_state_tree_id, &V_tree_id, s) != NULL) {
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+@@ -1134,7 +1134,7 @@
+ #endif
+ 			printf("pf: state insert failed: "
+ 			    "id: %016llx creatorid: %08x",
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    (unsigned long long)betoh64(s->id), ntohl(s->creatorid));
+ #else
+ 			    betoh64(s->id), ntohl(s->creatorid));
+@@ -1144,7 +1144,7 @@
+ 		pf_detach_state(s);
+ 		return (-1);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_INSERT_TAIL(&V_state_list, s, entry_list);
+ 	V_pf_status.fcounters[FCNT_STATE_INSERT]++;
+ 	V_pf_status.states++;
+@@ -1155,7 +1155,7 @@
+ #endif
+ 	pfi_kif_ref(kif, PFI_KIF_REF_STATE);
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pfsync_insert_state_ptr != NULL)
+ 		pfsync_insert_state_ptr(s);
+ #else
+@@ -1168,7 +1168,7 @@
+ struct pf_state *
+ pf_find_state_byid(struct pf_state_cmp *key)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pf_status.fcounters[FCNT_STATE_SEARCH]++;
+ 
+ 	return (RB_FIND(pf_state_tree_id, &V_tree_id, (struct pf_state *)key));
+@@ -1211,7 +1211,7 @@
+ }
+ 
+ struct pf_state *
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_find_state(struct pfi_kif *kif, struct pf_state_key_cmp *key, u_int dir,
+     struct mbuf *m, struct pf_mtag *pftag)
+ #else
+@@ -1222,18 +1222,18 @@
+ 	struct pf_state_key	*sk;
+ 	struct pf_state_item	*si;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pf_status.fcounters[FCNT_STATE_SEARCH]++;
+ #else
+ 	pf_status.fcounters[FCNT_STATE_SEARCH]++;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (dir == PF_OUT && pftag->statekey &&
+ 	    ((struct pf_state_key *)pftag->statekey)->reverse)
+ 		sk = ((struct pf_state_key *)pftag->statekey)->reverse;
+ 	else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((sk = RB_FIND(pf_state_tree, &V_pf_statetbl,
+ #else
+ 		if ((sk = RB_FIND(pf_state_tree, &pf_statetbl,
+@@ -1253,7 +1253,7 @@
+ 	    ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse)
+ 		sk = ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->reverse;
+ 	else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((sk = RB_FIND(pf_state_tree, &V_pf_statetbl,
+ #else
+ 		if ((sk = RB_FIND(pf_state_tree, &pf_statetbl,
+@@ -1271,7 +1271,7 @@
+ #endif
+ 
+ 	if (dir == PF_OUT)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pftag->statekey = NULL;
+ #else
+ 		m->m_pkthdr.pf.statekey = NULL;
+@@ -1279,7 +1279,7 @@
+ 
+ 	/* list is sorted, if-bound states before floating ones */
+ 	TAILQ_FOREACH(si, &sk->states, entry)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((si->s->kif == V_pfi_all || si->s->kif == kif) &&
+ #else
+ 		if ((si->s->kif == pfi_all || si->s->kif == kif) &&
+@@ -1297,13 +1297,13 @@
+ 	struct pf_state_key	*sk;
+ 	struct pf_state_item	*si, *ret = NULL;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pf_status.fcounters[FCNT_STATE_SEARCH]++;
+ #else
+ 	pf_status.fcounters[FCNT_STATE_SEARCH]++;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	sk = RB_FIND(pf_state_tree, &V_pf_statetbl, (struct pf_state_key *)key);
+ #else
+ 	sk = RB_FIND(pf_state_tree, &pf_statetbl, (struct pf_state_key *)key);
+@@ -1332,7 +1332,7 @@
+ pf_purge_thread(void *v)
+ {
+ 	int nloops = 0, s;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int locked;
+ #endif
+ 
+@@ -1341,7 +1341,7 @@
+ 	for (;;) {
+ 		tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		sx_slock(&V_pf_consistency_lock);
+ 		PF_LOCK();
+ 		locked = 0;
+@@ -1366,7 +1366,7 @@
+ 		s = splsoftnet();
+ 
+ 		/* process a fraction of the state table every second */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (!pf_purge_expired_states(1 + (V_pf_status.states /
+ 		    V_pf_default_rule.timeout[PFTM_INTERVAL]), 0)) {
+ 			PF_UNLOCK();
+@@ -1384,7 +1384,7 @@
+ #endif
+ 
+ 		/* purge other expired types every PFTM_INTERVAL seconds */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (++nloops >= V_pf_default_rule.timeout[PFTM_INTERVAL]) {
+ #else
+ 		if (++nloops >= pf_default_rule.timeout[PFTM_INTERVAL]) {
+@@ -1395,7 +1395,7 @@
+ 		}
+ 
+ 		splx(s);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ 		if (locked)
+ 			sx_xunlock(&V_pf_consistency_lock);
+@@ -1419,7 +1419,7 @@
+ 		return (time_second);
+ 	if (state->timeout == PFTM_UNTIL_PACKET)
+ 		return (0);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(state->timeout != PFTM_UNLINKED,
+ 	    ("pf_state_expires: timeout == PFTM_UNLINKED"));
+ 	KASSERT((state->timeout < PFTM_MAX), 
+@@ -1430,7 +1430,7 @@
+ #endif
+ 	timeout = state->rule.ptr->timeout[state->timeout];
+ 	if (!timeout)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		timeout = V_pf_default_rule.timeout[state->timeout];
+ #else
+ 		timeout = pf_default_rule.timeout[state->timeout];
+@@ -1440,7 +1440,7 @@
+ 		end = state->rule.ptr->timeout[PFTM_ADAPTIVE_END];
+ 		states = state->rule.ptr->states_cur;
+ 	} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		start = V_pf_default_rule.timeout[PFTM_ADAPTIVE_START];
+ 		end = V_pf_default_rule.timeout[PFTM_ADAPTIVE_END];
+ 		states = V_pf_status.states;
+@@ -1460,7 +1460,7 @@
+ 	return (state->expire + timeout);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int
+ pf_purge_expired_src_nodes(int waslocked)
+ #else
+@@ -1471,7 +1471,7 @@
+ 	struct pf_src_node		*cur, *next;
+ 	int				 locked = waslocked;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	for (cur = RB_MIN(pf_src_tree, &V_tree_src_tracking); cur; cur = next) {
+ 	next = RB_NEXT(pf_src_tree, &V_tree_src_tracking, cur);
+ #else
+@@ -1481,14 +1481,14 @@
+ 
+ 		if (cur->states <= 0 && cur->expire <= time_second) {
+ 			if (! locked) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (!sx_try_upgrade(&V_pf_consistency_lock))
+ 					return (0);
+ #else
+ 				rw_enter_write(&pf_consistency_lock);
+ #endif
+ 				next = RB_NEXT(pf_src_tree,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    &V_tree_src_tracking, cur);
+ #else
+ 				    &tree_src_tracking, cur);
+@@ -1501,7 +1501,7 @@
+ 				    cur->rule.ptr->max_src_nodes <= 0)
+ 					pf_rm_rule(NULL, cur->rule.ptr);
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			RB_REMOVE(pf_src_tree, &V_tree_src_tracking, cur);
+ 			V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++;
+ 			V_pf_status.src_nodes--;
+@@ -1516,7 +1516,7 @@
+ 	}
+ 
+ 	if (locked && !waslocked)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		sx_downgrade(&V_pf_consistency_lock);
+ 	}
+@@ -1538,7 +1538,7 @@
+ 			timeout = s->rule.ptr->timeout[PFTM_SRC_NODE];
+ 			if (!timeout)
+ 				timeout =
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    V_pf_default_rule.timeout[PFTM_SRC_NODE];
+ #else
+ 				    pf_default_rule.timeout[PFTM_SRC_NODE];
+@@ -1551,7 +1551,7 @@
+ 			timeout = s->rule.ptr->timeout[PFTM_SRC_NODE];
+ 			if (!timeout)
+ 				timeout =
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    V_pf_default_rule.timeout[PFTM_SRC_NODE];
+ #else
+ 				    pf_default_rule.timeout[PFTM_SRC_NODE];
+@@ -1566,7 +1566,7 @@
+ void
+ pf_unlink_state(struct pf_state *cur)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (cur->local_flags & PFSTATE_EXPIRING)
+ 		return;
+ 	cur->local_flags |= PFSTATE_EXPIRING;
+@@ -1576,7 +1576,7 @@
+ 
+ 	if (cur->src.state == PF_TCPS_PROXY_DST) {
+ 		/* XXX wire key the right one? */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_send_tcp(NULL, cur->rule.ptr, cur->key[PF_SK_WIRE]->af,
+ #else
+ 		pf_send_tcp(cur->rule.ptr, cur->key[PF_SK_WIRE]->af,
+@@ -1588,14 +1588,14 @@
+ 		    cur->src.seqhi, cur->src.seqlo + 1,
+ 		    TH_RST|TH_ACK, 0, 0, 0, 1, cur->tag, NULL, NULL);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_REMOVE(pf_state_tree_id, &V_tree_id, cur);
+ #else
+ 	RB_REMOVE(pf_state_tree_id, &tree_id, cur);
+ #endif
+ #if NPFLOW > 0
+ 	if (cur->state_flags & PFSTATE_PFLOW)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (export_pflow_ptr != NULL)
+ 			export_pflow_ptr(cur);
+ #else
+@@ -1603,7 +1603,7 @@
+ #endif
+ #endif
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pfsync_delete_state_ptr != NULL)
+ 		pfsync_delete_state_ptr(cur);
+ #else
+@@ -1620,12 +1620,12 @@
+ void
+ pf_free_state(struct pf_state *cur)
+ {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	splassert(IPL_SOFTNET);
+ #endif
+ 
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pfsync_state_in_use_ptr != NULL &&
+ 		pfsync_state_in_use_ptr(cur))
+ #else
+@@ -1633,7 +1633,7 @@
+ #endif
+ 		return;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT(cur->timeout == PFTM_UNLINKED,
+ 	    ("pf_free_state: cur->timeout != PFTM_UNLINKED"));
+ #else
+@@ -1651,14 +1651,14 @@
+ 			pf_rm_rule(NULL, cur->anchor.ptr);
+ 	pf_normalize_tcp_cleanup(cur);
+ 	pfi_kif_unref(cur->kif, PFI_KIF_REF_STATE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_REMOVE(&V_state_list, cur, entry_list);
+ #else
+ 	TAILQ_REMOVE(&state_list, cur, entry_list);
+ #endif
+ 	if (cur->tag)
+ 		pf_tag_unref(cur->tag);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pf_state_pl, cur);
+ 	V_pf_status.fcounters[FCNT_STATE_REMOVALS]++;
+ 	V_pf_status.states--;
+@@ -1669,7 +1669,7 @@
+ #endif
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int
+ pf_purge_expired_states(u_int32_t maxcheck, int waslocked)
+ #else
+@@ -1679,7 +1679,7 @@
+ {
+ 	static struct pf_state	*cur = NULL;
+ 	struct pf_state		*next;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int			 locked = waslocked;
+ #else
+ 	int			 locked = 0;
+@@ -1688,7 +1688,7 @@
+ 	while (maxcheck--) {
+ 		/* wrap to start of list when we hit the end */
+ 		if (cur == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			cur = TAILQ_FIRST(&V_state_list);
+ #else
+ 			cur = TAILQ_FIRST(&state_list);
+@@ -1703,7 +1703,7 @@
+ 		if (cur->timeout == PFTM_UNLINKED) {
+ 			/* free unlinked state */
+ 			if (! locked) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (!sx_try_upgrade(&V_pf_consistency_lock))
+ 					return (0);
+ #else
+@@ -1716,7 +1716,7 @@
+ 			/* unlink and free expired state */
+ 			pf_unlink_state(cur);
+ 			if (! locked) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (!sx_try_upgrade(&V_pf_consistency_lock))
+ 					return (0);
+ #else
+@@ -1729,7 +1729,7 @@
+ 		cur = next;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!waslocked && locked)
+ 		sx_downgrade(&V_pf_consistency_lock);
+ 
+@@ -2216,7 +2216,7 @@
+     struct tcphdr *th, struct pf_state_peer *dst)
+ {
+ 	int hlen = (th->th_off << 2) - sizeof(*th), thoptlen = hlen;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int8_t opts[TCP_MAXOLEN], *opt = opts;
+ #else
+ 	u_int8_t opts[MAX_TCPOPTLEN], *opt = opts;
+@@ -2264,7 +2264,7 @@
+ 	}
+ 
+ 	if (copyback)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m_copyback(m, off + sizeof(*th), thoptlen, (caddr_t)opts);
+ #else
+ 		m_copyback(m, off + sizeof(*th), thoptlen, opts);
+@@ -2273,7 +2273,7 @@
+ }
+ 
+ void
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_send_tcp(struct mbuf *replyto, const struct pf_rule *r, sa_family_t af,
+ #else
+ pf_send_tcp(const struct pf_rule *r, sa_family_t af,
+@@ -2293,7 +2293,7 @@
+ #endif /* INET6 */
+ 	struct tcphdr	*th;
+ 	char		*opt;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pf_mtag  *pf_mtag;
+ 
+ 	KASSERT(
+@@ -2341,7 +2341,7 @@
+ 	m = m_gethdr(M_DONTWAIT, MT_HEADER);
+ 	if (m == NULL)
+ 		return;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef MAC
+ 	mac_netinet_firewall_send(m);
+ #endif
+@@ -2351,7 +2351,7 @@
+ 	}
+ #endif
+ 	if (tag)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m->m_flags |= M_SKIP_FIREWALL;
+ 	pf_mtag->tag = rtag;
+ #else
+@@ -2360,20 +2360,20 @@
+ #endif
+ 
+ 	if (r != NULL && r->rtableid >= 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		M_SETFIB(m, r->rtableid);
+ 		pf_mtag->rtableid = r->rtableid;
+ #else
+ 		m->m_pkthdr.pf.rtableid = r->rtableid;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	}
+ #endif
+ 
+ #ifdef ALTQ
+ 	if (r != NULL && r->qid) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_mtag->qid = r->qid;
+ 
+ 		/* add hints for ecn */
+@@ -2445,7 +2445,7 @@
+ 		h->ip_v = 4;
+ 		h->ip_hl = sizeof(*h) >> 2;
+ 		h->ip_tos = IPTOS_LOWDELAY;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		h->ip_off = V_path_mtu_discovery ? IP_DF : 0;
+ 		h->ip_len = len;
+ 		h->ip_ttl = ttl ? ttl : V_ip_defttl;
+@@ -2456,7 +2456,7 @@
+ #endif
+ 		h->ip_sum = 0;
+ 		if (eh == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ 		ip_output(m, (void *)NULL, (void *)NULL, 0,
+ 		    (void *)NULL, (void *)NULL);
+@@ -2481,7 +2481,7 @@
+ 			bcopy(eh->ether_dhost, e->ether_shost, ETHER_ADDR_LEN);
+ 			bcopy(eh->ether_shost, e->ether_dhost, ETHER_ADDR_LEN);
+ 			e->ether_type = eh->ether_type;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ 			/* XXX_IMPORT: later */
+ 			ip_output(m, (void *)NULL, &ro, 0,
+@@ -2503,7 +2503,7 @@
+ 		h6->ip6_vfc |= IPV6_VERSION;
+ 		h6->ip6_hlim = IPV6_DEFHLIM;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ 		ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL);
+ 		PF_LOCK();
+@@ -2520,14 +2520,14 @@
+     struct pf_rule *r)
+ {
+ 	struct mbuf	*m0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef INET
+ 	struct ip *ip;
+ #endif
+ 	struct pf_mtag *pf_mtag;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	m0 = m_copypacket(m, M_DONTWAIT);
+ 	if (m0 == NULL)
+ 		return;
+@@ -2536,7 +2536,7 @@
+ 		return;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((pf_mtag = pf_get_mtag(m0)) == NULL)
+ 		return;
+ 	/* XXX: revisit */
+@@ -2546,20 +2546,20 @@
+ #endif
+ 
+ 	if (r->rtableid >= 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		M_SETFIB(m0, r->rtableid);
+ 		pf_mtag->rtableid = r->rtableid;
+ #else
+ 		m0->m_pkthdr.pf.rtableid = r->rtableid;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	}
+ #endif
+ 
+ #ifdef ALTQ
+ 	if (r->qid) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_mtag->qid = r->qid;
+ 		/* add hints for ecn */
+ 		pf_mtag->hdr = mtod(m0, struct ip *);
+@@ -2574,7 +2574,7 @@
+ 	switch (af) {
+ #ifdef INET
+ 	case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/* icmp_error() expects host byte ordering */
+ 		ip = mtod(m0, struct ip *);
+ 		NTOHS(ip->ip_len);
+@@ -2589,11 +2589,11 @@
+ #endif /* INET */
+ #ifdef INET6
+ 	case AF_INET6:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		icmp6_error(m0, type, code, 0);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		break;
+@@ -2737,7 +2737,7 @@
+ }
+ 
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_match_tag(struct mbuf *m, struct pf_rule *r, int *tag,
+     struct pf_mtag *pf_mtag)
+ #else
+@@ -2745,7 +2745,7 @@
+ #endif
+ {
+ 	if (*tag == -1)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		*tag = pf_mtag->tag;
+ #else
+ 		*tag = m->m_pkthdr.pf.tag;
+@@ -2756,7 +2756,7 @@
+ }
+ 
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_tag_packet(struct mbuf *m, int tag, int rtableid,
+     struct pf_mtag *pf_mtag)
+ #else
+@@ -2767,13 +2767,13 @@
+ 		return (0);
+ 
+ 	if (tag > 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_mtag->tag = tag;
+ #else
+ 		m->m_pkthdr.pf.tag = tag;
+ #endif
+ 	if (rtableid >= 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		M_SETFIB(m, rtableid);
+ 	}
+@@ -2793,7 +2793,7 @@
+ 	(*r)->anchor->match = 0;
+ 	if (match)
+ 		*match = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (*depth >= sizeof(V_pf_anchor_stack) /
+ 	    sizeof(V_pf_anchor_stack[0])) {
+ #else
+@@ -2805,7 +2805,7 @@
+ 		return;
+ 	} else if (*depth == 0 && a != NULL)
+ 		*a = *r;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	f = V_pf_anchor_stack + (*depth)++;
+ #else
+ 	f = pf_anchor_stack + (*depth)++;
+@@ -2838,7 +2838,7 @@
+ 	do {
+ 		if (*depth <= 0)
+ 			break;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		f = V_pf_anchor_stack + *depth - 1;
+ #else
+ 		f = pf_anchor_stack + *depth - 1;
+@@ -2929,7 +2929,7 @@
+ #endif /* INET6 */
+ 
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_socket_lookup(int direction, struct pf_pdesc *pd, struct inpcb *inp_arg)
+ #else
+ pf_socket_lookup(int direction, struct pf_pdesc *pd)
+@@ -2937,7 +2937,7 @@
+ {
+ 	struct pf_addr		*saddr, *daddr;
+ 	u_int16_t		 sport, dport;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct inpcbinfo	*pi;
+ #else
+ 	struct inpcbtable	*tb;
+@@ -2950,7 +2950,7 @@
+ 	pd->lookup.gid = GID_MAX;
+ 	pd->lookup.pid = NO_PID;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (inp_arg != NULL) {
+ 		INP_LOCK_ASSERT(inp_arg);
+ 		pd->lookup.uid = inp_arg->inp_cred->cr_uid;
+@@ -2965,7 +2965,7 @@
+ 			return (-1);
+ 		sport = pd->hdr.tcp->th_sport;
+ 		dport = pd->hdr.tcp->th_dport;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pi = &V_tcbinfo;
+ #else
+ 		tb = &tcbtable;
+@@ -2976,7 +2976,7 @@
+ 			return (-1);
+ 		sport = pd->hdr.udp->uh_sport;
+ 		dport = pd->hdr.udp->uh_dport;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pi = &V_udbinfo;
+ #else
+ 		tb = &udbtable;
+@@ -3000,7 +3000,7 @@
+ 	switch (pd->af) {
+ #ifdef INET
+ 	case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/*
+ 		 * XXXRW: would be nice if we had an mbuf here so that we
+ 		 * could use in_pcblookup_mbuf().
+@@ -3027,7 +3027,7 @@
+ #endif /* INET */
+ #ifdef INET6
+ 	case AF_INET6:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/*
+ 		 * XXXRW: would be nice if we had an mbuf here so that we
+ 		 * could use in6_pcblookup_mbuf().
+@@ -3057,7 +3057,7 @@
+ 	default:
+ 		return (-1);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	INP_RLOCK_ASSERT(inp);
+ 	pd->lookup.uid = inp->inp_cred->cr_uid;
+ 	pd->lookup.gid = inp->inp_cred->cr_groups[0];
+@@ -3116,7 +3116,7 @@
+ 	int		 hlen;
+ 	u_int8_t	 hdr[60];
+ 	u_int8_t	*opt, optlen;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int16_t	 mss = V_tcp_mssdflt;
+ #else
+ 	u_int16_t	 mss = tcp_mssdflt;
+@@ -3164,7 +3164,7 @@
+ 	struct route_in6	 ro6;
+ #endif /* INET6 */
+ 	struct rtentry		*rt = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int			 hlen = 0;
+ 	u_int16_t		 mss = V_tcp_mssdflt;
+ #else
+@@ -3181,7 +3181,7 @@
+ 		dst->sin_family = AF_INET;
+ 		dst->sin_len = sizeof(*dst);
+ 		dst->sin_addr = addr->v4;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RTF_PRCLONING
+ 		rtalloc_ign(&ro, (RTF_CLONING | RTF_PRCLONING));
+ #else /* !RTF_PRCLONING */
+@@ -3201,7 +3201,7 @@
+ 		dst6->sin6_family = AF_INET6;
+ 		dst6->sin6_len = sizeof(*dst6);
+ 		dst6->sin6_addr = addr->v6;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RTF_PRCLONING
+ 		rtalloc_ign((struct route *)&ro6,
+ 		    (RTF_CLONING | RTF_PRCLONING));
+@@ -3218,7 +3218,7 @@
+ 
+ 	if (rt && rt->rt_ifp) {
+ 		mss = rt->rt_ifp->if_mtu - hlen - sizeof(struct tcphdr);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		mss = max(V_tcp_mssdflt, mss);
+ #else
+ 		mss = max(tcp_mssdflt, mss);
+@@ -3261,7 +3261,7 @@
+ 	MD5_CTX ctx;
+ 	u_int32_t digest[4];
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pf_tcp_secret_init == 0) {
+ 		read_random(&V_pf_tcp_secret, sizeof(V_pf_tcp_secret));
+ 		MD5Init(&V_pf_tcp_secret_ctx);
+@@ -3293,7 +3293,7 @@
+ 		MD5Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr));
+ 	}
+ 	MD5Final((u_char *)digest, &ctx);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pf_tcp_iss_off += 4096;
+ #define	ISN_RANDOM_INCREMENT (4096 - 1)
+ 	return (digest[0] + (arc4random() & ISN_RANDOM_INCREMENT) +
+@@ -3309,7 +3309,7 @@
+ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
+     struct pfi_kif *kif, struct mbuf *m, int off, void *h,
+     struct pf_pdesc *pd, struct pf_rule **am, struct pf_ruleset **rsm,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+     struct ifqueue *ifq, struct inpcb *inp)
+ #else
+     struct ifqueue *ifq)
+@@ -3330,7 +3330,7 @@
+ 	int			 asd = 0;
+ 	int			 match = 0;
+ 	int			 state_icmp = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int16_t		 sport = 0, dport = 0;
+ 	u_int16_t		 bproto_sum = 0, bip_sum = 0;
+ #else
+@@ -3345,7 +3345,7 @@
+ 		return (PF_DROP);
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (inp != NULL)
+ 		pd->lookup.done = pf_socket_lookup(direction, pd, inp);
+ 	else if (V_debug_pfugidhack) {
+@@ -3576,7 +3576,7 @@
+ 			r = TAILQ_NEXT(r, entries);
+ 		/* tcp/udp only. uid.op always 0 in other cases */
+ 		else if (r->uid.op && (pd->lookup.done || (pd->lookup.done =
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    pf_socket_lookup(direction, pd, inp), 1)) &&
+ #else
+ 		    pf_socket_lookup(direction, pd), 1)) &&
+@@ -3586,7 +3586,7 @@
+ 			r = TAILQ_NEXT(r, entries);
+ 		/* tcp/udp only. gid.op always 0 in other cases */
+ 		else if (r->gid.op && (pd->lookup.done || (pd->lookup.done =
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    pf_socket_lookup(direction, pd, inp), 1)) &&
+ #else
+ 		    pf_socket_lookup(direction, pd), 1)) &&
+@@ -3595,13 +3595,13 @@
+ 		    pd->lookup.gid))
+ 			r = TAILQ_NEXT(r, entries);
+ 		else if (r->prob &&
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    r->prob <= arc4random())
+ #else
+ 		    r->prob <= arc4random_uniform(UINT_MAX - 1) + 1)
+ #endif
+ 			r = TAILQ_NEXT(r, entries);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag))
+ #else
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag))
+@@ -3699,7 +3699,7 @@
+ 					ack++;
+ 				if (th->th_flags & TH_FIN)
+ 					ack++;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pf_send_tcp(m, r, af, pd->dst,
+ #else
+ 				pf_send_tcp(r, af, pd->dst,
+@@ -3721,7 +3721,7 @@
+ 	if (r->action == PF_DROP)
+ 		goto cleanup;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pf_tag_packet(m, tag, rtableid, pd->pf_mtag)) {
+ #else
+ 	if (pf_tag_packet(m, tag, rtableid)) {
+@@ -3739,7 +3739,7 @@
+ 		if (action != PF_PASS)
+ 			return (action);
+ 	} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (sk != NULL)
+ 			pool_put(&V_pf_state_key_pl, sk);
+ 		if (nk != NULL)
+@@ -3758,7 +3758,7 @@
+ 
+ #if NPFSYNC > 0
+ 	if (*sm != NULL && !ISSET((*sm)->state_flags, PFSTATE_NOSYNC) &&
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	    direction == PF_OUT && pfsync_up_ptr != NULL && pfsync_up_ptr()) {
+ #else
+ 	    direction == PF_OUT && pfsync_up()) {
+@@ -3769,7 +3769,7 @@
+ 		 * firewall has to know about it to allow
+ 		 * replies through it.
+ 		 */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pfsync_defer_ptr != NULL &&
+ 			pfsync_defer_ptr(*sm, m))
+ #else
+@@ -3782,7 +3782,7 @@
+ 	return (PF_PASS);
+ 
+ cleanup:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sk != NULL)
+ 		pool_put(&V_pf_state_key_pl, sk);
+ 	if (nk != NULL)
+@@ -3807,7 +3807,7 @@
+ 	struct pf_state		*s = NULL;
+ 	struct pf_src_node	*sn = NULL;
+ 	struct tcphdr		*th = pd->hdr.tcp;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int16_t		 mss = V_tcp_mssdflt;
+ #else
+ 	u_int16_t		 mss = tcp_mssdflt;
+@@ -3816,7 +3816,7 @@
+ 
+ 	/* check maximums */
+ 	if (r->max_states && (r->states_cur >= r->max_states)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.lcounters[LCNT_STATES]++;
+ #else
+ 		pf_status.lcounters[LCNT_STATES]++;
+@@ -3837,7 +3837,7 @@
+ 		REASON_SET(&reason, PFRES_SRCLIMIT);
+ 		goto csfailed;
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	s = pool_get(&V_pf_state_pl, PR_NOWAIT | PR_ZERO);
+ #else
+ 	s = pool_get(&pf_state_pl, PR_NOWAIT | PR_ZERO);
+@@ -3932,7 +3932,7 @@
+ 			REASON_SET(&reason, PFRES_MEMORY);
+ 			pf_src_tree_remove_state(s);
+ 			STATE_DEC_COUNTERS(s);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_state_pl, s);
+ #else
+ 			pool_put(&pf_state_pl, s);
+@@ -3948,7 +3948,7 @@
+ 			pf_normalize_tcp_cleanup(s);
+ 			pf_src_tree_remove_state(s);
+ 			STATE_DEC_COUNTERS(s);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_state_pl, s);
+ #else
+ 			pool_put(&pf_state_pl, s);
+@@ -3968,7 +3968,7 @@
+ 		REASON_SET(&reason, PFRES_STATEINS);
+ 		pf_src_tree_remove_state(s);
+ 		STATE_DEC_COUNTERS(s);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_state_pl, s);
+ #else
+ 		pool_put(&pf_state_pl, s);
+@@ -4008,7 +4008,7 @@
+ 		mss = pf_calc_mss(pd->src, pd->af, mss);
+ 		mss = pf_calc_mss(pd->dst, pd->af, mss);
+ 		s->src.mss = mss;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport,
+ #else
+ 		pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport,
+@@ -4022,7 +4022,7 @@
+ 	return (PF_PASS);
+ 
+ csfailed:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (sk != NULL)
+ 		pool_put(&V_pf_state_key_pl, sk);
+ 	if (nk != NULL)
+@@ -4035,7 +4035,7 @@
+ #endif
+ 
+ 	if (sn != NULL && sn->states == 0 && sn->expire == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_src_tree, &V_tree_src_tracking, sn);
+ 		V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++;
+ 		V_pf_status.src_nodes--;
+@@ -4048,7 +4048,7 @@
+ #endif
+ 	}
+ 	if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_src_tree, &V_tree_src_tracking, nsn);
+ 		V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++;
+ 		V_pf_status.src_nodes--;
+@@ -4110,7 +4110,7 @@
+ 		else if (r->prob && r->prob <=
+ 		    (arc4random() % (UINT_MAX - 1) + 1))
+ 			r = TAILQ_NEXT(r, entries);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag))
+ #else
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag))
+@@ -4146,7 +4146,7 @@
+ 	if (r->action != PF_PASS)
+ 		return (PF_DROP);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pf_tag_packet(m, tag, -1, pd->pf_mtag)) {
+ #else
+ 	if (pf_tag_packet(m, tag, -1)) {
+@@ -4405,7 +4405,7 @@
+ 		 * and keep updating the state TTL.
+ 		 */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -4415,7 +4415,7 @@
+ 			pf_print_flags(th->th_flags);
+ 			printf(" seq=%u (%u) ack=%u len=%u ackskew=%d "
+ 			    "pkts=%llu:%llu dir=%s,%s\n", seq, orig_seq, ack,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    pd->p_len, ackskew, (unsigned long long)(*state)->packets[0],
+ 			    (unsigned long long)(*state)->packets[1],
+ #else
+@@ -4460,7 +4460,7 @@
+ 		    (*state)->src.state == TCPS_SYN_SENT) {
+ 			/* Send RST for state mismatches during handshake */
+ 			if (!(th->th_flags & TH_RST))
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
+ #else
+ 				pf_send_tcp((*state)->rule.ptr, pd->af,
+@@ -4473,7 +4473,7 @@
+ 			src->seqlo = 0;
+ 			src->seqhi = 1;
+ 			src->max_win = 1;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		} else if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 		} else if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -4484,7 +4484,7 @@
+ 			printf(" seq=%u (%u) ack=%u len=%u ackskew=%d "
+ 			    "pkts=%llu:%llu dir=%s,%s\n",
+ 			    seq, orig_seq, ack, pd->p_len, ackskew,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    (unsigned long long)(*state)->packets[0],
+ 			    (unsigned long long)(*state)->packets[1],
+ #else
+@@ -4604,7 +4604,7 @@
+ 		key.port[0] = th->th_dport;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 	STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -4630,7 +4630,7 @@
+ 				REASON_SET(reason, PFRES_SYNPROXY);
+ 				return (PF_DROP);
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst,
+ #else
+ 			pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst,
+@@ -4664,7 +4664,7 @@
+ 			(*state)->src.max_win = MAX(ntohs(th->th_win), 1);
+ 			if ((*state)->dst.seqhi == 1)
+ 				(*state)->dst.seqhi = htonl(arc4random());
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
+ #else
+ 			pf_send_tcp((*state)->rule.ptr, pd->af,
+@@ -4683,7 +4683,7 @@
+ 		} else {
+ 			(*state)->dst.max_win = MAX(ntohs(th->th_win), 1);
+ 			(*state)->dst.seqlo = ntohl(th->th_seq);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst,
+ #else
+ 			pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst,
+@@ -4692,7 +4692,7 @@
+ 			    ntohl(th->th_ack), ntohl(th->th_seq) + 1,
+ 			    TH_ACK, (*state)->src.max_win, 0, 0, 0,
+ 			    (*state)->tag, NULL, NULL);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pf_send_tcp(NULL, (*state)->rule.ptr, pd->af,
+ #else
+ 			pf_send_tcp((*state)->rule.ptr, pd->af,
+@@ -4721,7 +4721,7 @@
+ 	if (((th->th_flags & (TH_SYN|TH_ACK)) == TH_SYN) &&
+ 	    dst->state >= TCPS_FIN_WAIT_2 &&
+ 	    src->state >= TCPS_FIN_WAIT_2) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -4767,7 +4767,7 @@
+ 
+ 	/* Copyback sequence modulation or stateful scrub changes if needed */
+ 	if (copyback)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m_copyback(m, off, sizeof(*th), (caddr_t)th);
+ #else
+ 		m_copyback(m, off, sizeof(*th), th);
+@@ -4798,7 +4798,7 @@
+ 		key.port[0] = uh->uh_dport;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 	STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -4840,7 +4840,7 @@
+ 			pf_change_ap(pd->dst, &uh->uh_dport, pd->ip_sum,
+ 			    &uh->uh_sum, &nk->addr[pd->didx],
+ 			    nk->port[pd->didx], 1, pd->af);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m_copyback(m, off, sizeof(*uh), (caddr_t)uh);
+ #else
+ 		m_copyback(m, off, sizeof(*uh), uh);
+@@ -4855,7 +4855,7 @@
+     struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason)
+ {
+ 	struct pf_addr  *saddr = pd->src, *daddr = pd->dst;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int16_t	 icmpid = 0, *icmpsum;
+ #else
+ 	u_int16_t	 icmpid, *icmpsum;
+@@ -4911,7 +4911,7 @@
+ 			PF_ACPY(&key.addr[0], pd->dst, key.af);
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 		STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -4950,7 +4950,7 @@
+ 				}
+ 
+ 				m_copyback(m, off, ICMP_MINLEN,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    (caddr_t)
+ #endif
+ 				    pd->hdr.icmp);
+@@ -4972,7 +4972,7 @@
+ 
+ 				m_copyback(m, off,
+ 				    sizeof(struct icmp6_hdr),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    (caddr_t)
+ #endif
+ 				    pd->hdr.icmp6);
+@@ -4989,7 +4989,7 @@
+ 		 */
+ 
+ 		struct pf_pdesc	pd2;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		bzero(&pd2, sizeof pd2);
+ #endif
+ #ifdef INET
+@@ -4999,7 +4999,7 @@
+ 		struct ip6_hdr	h2_6;
+ 		int		terminal = 0;
+ #endif /* INET6 */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		int		ipoff2 = 0;
+ 		int		off2 = 0;
+ #else
+@@ -5126,7 +5126,7 @@
+ 			key.port[pd2.sidx] = th.th_sport;
+ 			key.port[pd2.didx] = th.th_dport;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 			STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5156,7 +5156,7 @@
+ 			if (!((*state)->state_flags & PFSTATE_SLOPPY) &&
+ 			    (!SEQ_GEQ(src->seqhi, seq) ||
+ 			    !SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)))) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 				if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -5173,7 +5173,7 @@
+ 				REASON_SET(reason, PFRES_BADSTATE);
+ 				return (PF_DROP);
+ 			} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 				if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -5221,12 +5221,12 @@
+ #ifdef INET
+ 				case AF_INET:
+ 					m_copyback(m, off, ICMP_MINLEN,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    pd->hdr.icmp);
+ 					m_copyback(m, ipoff2, sizeof(h2),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    &h2);
+@@ -5236,19 +5236,19 @@
+ 				case AF_INET6:
+ 					m_copyback(m, off,
+ 					    sizeof(struct icmp6_hdr),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    pd->hdr.icmp6);
+ 					m_copyback(m, ipoff2, sizeof(h2_6),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    &h2_6);
+ 					break;
+ #endif /* INET6 */
+ 				}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				m_copyback(m, off2, 8, (caddr_t)&th);
+ #else
+ 				m_copyback(m, off2, 8, &th);
+@@ -5276,7 +5276,7 @@
+ 			key.port[pd2.sidx] = uh.uh_sport;
+ 			key.port[pd2.didx] = uh.uh_dport;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 			STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5311,11 +5311,11 @@
+ #ifdef INET
+ 				case AF_INET:
+ 					m_copyback(m, off, ICMP_MINLEN,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    pd->hdr.icmp);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2);
+ #else
+ 					m_copyback(m, ipoff2, sizeof(h2), &h2);
+@@ -5326,19 +5326,19 @@
+ 				case AF_INET6:
+ 					m_copyback(m, off,
+ 					    sizeof(struct icmp6_hdr),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    pd->hdr.icmp6);
+ 					m_copyback(m, ipoff2, sizeof(h2_6),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    &h2_6);
+ 					break;
+ #endif /* INET6 */
+ 				}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				m_copyback(m, off2, sizeof(uh), (caddr_t)&uh);
+ #else
+ 				m_copyback(m, off2, sizeof(uh), &uh);
+@@ -5365,7 +5365,7 @@
+ 			PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af);
+ 			key.port[0] = key.port[1] = iih.icmp_id;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 			STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5396,7 +5396,7 @@
+ 					    pd2.ip_sum, icmpsum,
+ 					    pd->ip_sum, 0, AF_INET);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp);
+ 				m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2);
+ 				m_copyback(m, off2, ICMP_MINLEN, (caddr_t)&iih);
+@@ -5428,7 +5428,7 @@
+ 			PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af);
+ 			key.port[0] = key.port[1] = iih.icmp6_id;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 			STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5459,7 +5459,7 @@
+ 					    pd2.ip_sum, icmpsum,
+ 					    pd->ip_sum, 0, AF_INET6);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				m_copyback(m, off, sizeof(struct icmp6_hdr),
+ 				    (caddr_t)pd->hdr.icmp6);
+ 				m_copyback(m, ipoff2, sizeof(h2_6), (caddr_t)&h2_6);
+@@ -5484,7 +5484,7 @@
+ 			PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af);
+ 			key.port[0] = key.port[1] = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 			STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5514,7 +5514,7 @@
+ 				switch (pd2.af) {
+ #ifdef INET
+ 				case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					m_copyback(m, off, ICMP_MINLEN,
+ 					    (caddr_t)pd->hdr.icmp);
+ 					m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2);
+@@ -5529,12 +5529,12 @@
+ 				case AF_INET6:
+ 					m_copyback(m, off,
+ 					    sizeof(struct icmp6_hdr),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    pd->hdr.icmp6);
+ 					m_copyback(m, ipoff2, sizeof(h2_6),
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    (caddr_t)
+ #endif
+ 					    &h2_6);
+@@ -5568,7 +5568,7 @@
+ 		key.port[1] = key.port[0] = 0;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	STATE_LOOKUP(kif, &key, direction, *state, m, pd->pf_mtag);
+ #else
+ 	STATE_LOOKUP(kif, &key, direction, *state, m);
+@@ -5599,7 +5599,7 @@
+ 	if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) {
+ 		struct pf_state_key *nk = (*state)->key[pd->didx];
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		KASSERT(nk, ("%s: nk is null", __FUNCTION__));
+ 		KASSERT(pd, ("%s: pd is null", __FUNCTION__));
+ 		KASSERT(pd->src, ("%s: pd->src is null", __FUNCTION__));
+@@ -5695,7 +5695,7 @@
+ int
+ pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RADIX_MPATH
+ 	struct radix_node_head	*rnh;
+ #endif
+@@ -5703,11 +5703,11 @@
+ 	struct sockaddr_in	*dst;
+ 	int			 ret = 1;
+ 	int			 check_mpath;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	extern int		 ipmultipath;
+ #endif
+ #ifdef INET6
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	extern int		 ip6_multipath;
+ #endif
+ 	struct sockaddr_in6	*dst6;
+@@ -5720,7 +5720,7 @@
+ 	struct ifnet		*ifp;
+ 
+ 	check_mpath = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RADIX_MPATH
+ 	/* XXX: stick to table 0 for now */
+ 	rnh = rt_tables_get_rnh(0, af);
+@@ -5735,7 +5735,7 @@
+ 		dst->sin_family = AF_INET;
+ 		dst->sin_len = sizeof(*dst);
+ 		dst->sin_addr = addr->v4;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 		if (ipmultipath)
+ 			check_mpath = 1;
+ #endif
+@@ -5752,7 +5752,7 @@
+ 		dst6->sin6_family = AF_INET6;
+ 		dst6->sin6_len = sizeof(*dst6);
+ 		dst6->sin6_addr = addr->v6;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 		if (ip6_multipath)
+ 			check_mpath = 1;
+ #endif
+@@ -5766,7 +5766,7 @@
+ 	if (kif != NULL && kif->pfik_ifp->if_type == IFT_ENC)
+ 		goto out;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ /* XXX MRT not always INET */ /* stick with table 0 though */
+ #ifdef INET
+ 	if (af == AF_INET)
+@@ -5793,7 +5793,7 @@
+ 		rn = (struct radix_node *)ro.ro_rt;
+ 		do {
+ 			rt = (struct rtentry *)rn;
+-#ifndef __FreeBSD__ /* CARPDEV */
++#ifndef __FreeBSD_kernel__ /* CARPDEV */
+ 			if (rt->rt_ifp->if_type == IFT_CARP)
+ 				ifp = rt->rt_ifp->if_carpdev;
+ 			else
+@@ -5802,7 +5802,7 @@
+ 
+ 			if (kif->pfik_ifp == ifp)
+ 				ret = 1;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef RADIX_MPATH
+ 			rn = rn_mpath_next(rn);
+ #endif
+@@ -5850,7 +5850,7 @@
+ 		return (0);
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ # ifdef RTF_PRCLONING
+ 	rtalloc_ign((struct route *)&ro, (RTF_CLONING|RTF_PRCLONING));
+ # else /* !RTF_PRCLONING */
+@@ -5866,7 +5866,7 @@
+ #endif
+ 
+ 	if (ro.ro_rt != NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/* XXX_IMPORT: later */
+ #else
+ 		if (ro.ro_rt->rt_labelid == aw->v.rtlabel)
+@@ -5892,7 +5892,7 @@
+ 	struct pf_addr		 naddr;
+ 	struct pf_src_node	*sn = NULL;
+ 	int			 error = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int sw_csum;
+ #endif
+ #ifdef IPSEC
+@@ -5903,7 +5903,7 @@
+ 	    (dir != PF_IN && dir != PF_OUT) || oifp == NULL)
+ 		panic("pf_route: invalid parameters");
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pd->pf_mtag->routed++ > 3) {
+ #else
+ 	if ((*m)->m_pkthdr.pf.routed++ > 3) {
+@@ -5914,7 +5914,7 @@
+ 	}
+ 
+ 	if (r->rt == PF_DUPTO) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((m0 = m_dup(*m, M_DONTWAIT)) == NULL)
+ #else
+ 		if ((m0 = m_copym2(*m, 0, M_COPYALL, M_NOWAIT)) == NULL)
+@@ -5942,13 +5942,13 @@
+ 	dst->sin_addr = ip->ip_dst;
+ 
+ 	if (r->rt == PF_FASTROUTE) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		in_rtalloc(ro, 0);
+ #else
+ 		rtalloc(ro);
+ #endif
+ 		if (ro->ro_rt == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			KMOD_IPSTAT_INC(ips_noroute);
+ #else
+ 			ipstat.ips_noroute++;
+@@ -5985,7 +5985,7 @@
+ 		goto bad;
+ 
+ 	if (oifp != ifp) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ 		if (pf_test(PF_OUT, ifp, &m0, NULL, NULL) != PF_PASS) {
+ 			PF_LOCK();
+@@ -6009,7 +6009,7 @@
+ 		ip = mtod(m0, struct ip *);
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* Copied from FreeBSD 5.1-CURRENT ip_output. */
+ 	m0->m_pkthdr.csum_flags |= CSUM_IP;
+ 	sw_csum = m0->m_pkthdr.csum_flags & ~ifp->if_hwassist;
+@@ -6083,7 +6083,7 @@
+ 		if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
+ 		    ifp->if_bridge == NULL) {
+ 			m0->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			KMOD_IPSTAT_INC(ips_outhwcsum);
+ #else
+ 			ipstat.ips_outhwcsum++;
+@@ -6105,13 +6105,13 @@
+ 	 * Must be able to put at least 8 bytes per fragment.
+ 	 */
+ 	if (ip->ip_off & htons(IP_DF)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		KMOD_IPSTAT_INC(ips_cantfrag);
+ #else
+ 		ipstat.ips_cantfrag++;
+ #endif
+ 		if (r->rt != PF_DUPTO) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			/* icmp_error() expects host byte ordering */
+ 			NTOHS(ip->ip_len);
+ 			NTOHS(ip->ip_off);
+@@ -6129,7 +6129,7 @@
+ 	}
+ 
+ 	m1 = m0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/*
+ 	 * XXX: is cheaper + less error prone than own function
+ 	 */
+@@ -6140,7 +6140,7 @@
+ 	error = ip_fragment(m0, ifp, ifp->if_mtu);
+ #endif
+ 	if (error) {
+-#ifndef __FreeBSD__    /* ip_fragment does not do m_freem() on FreeBSD */
++#ifndef __FreeBSD_kernel__    /* ip_fragment does not do m_freem() on FreeBSD */
+ 		m0 = NULL;
+ #endif
+ 		goto bad;
+@@ -6149,7 +6149,7 @@
+ 	for (m0 = m1; m0; m0 = m1) {
+ 		m1 = m0->m_nextpkt;
+ 		m0->m_nextpkt = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (error == 0) {
+ 			PF_UNLOCK();
+ 			error = (*ifp->if_output)(ifp, m0, sintosa(dst),
+@@ -6166,7 +6166,7 @@
+ 	}
+ 
+ 	if (error == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		KMOD_IPSTAT_INC(ips_fragmented);
+ #else
+ 		ipstat.ips_fragmented++;
+@@ -6203,7 +6203,7 @@
+ 	    (dir != PF_IN && dir != PF_OUT) || oifp == NULL)
+ 		panic("pf_route6: invalid parameters");
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pd->pf_mtag->routed++ > 3) {
+ #else
+ 	if ((*m)->m_pkthdr.pf.routed++ > 3) {
+@@ -6214,7 +6214,7 @@
+ 	}
+ 
+ 	if (r->rt == PF_DUPTO) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((m0 = m_dup(*m, M_DONTWAIT)) == NULL)
+ #else
+ 		if ((m0 = m_copym2(*m, 0, M_COPYALL, M_NOWAIT)) == NULL)
+@@ -6242,7 +6242,7 @@
+ 
+ 	/* Cheat. XXX why only in the v6 case??? */
+ 	if (r->rt == PF_FASTROUTE) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m0->m_flags |= M_SKIP_FIREWALL;
+ 		PF_UNLOCK();
+ 		ip6_output(m0, NULL, NULL, 0, NULL, NULL, NULL);
+@@ -6275,7 +6275,7 @@
+ 		goto bad;
+ 
+ 	if (oifp != ifp) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ 		if (pf_test6(PF_OUT, ifp, &m0, NULL, NULL) != PF_PASS) {
+ 			PF_LOCK();
+@@ -6306,16 +6306,16 @@
+ 	if (IN6_IS_SCOPE_EMBED(&dst->sin6_addr))
+ 		dst->sin6_addr.s6_addr16[1] = htons(ifp->if_index);
+ 	if ((u_long)m0->m_pkthdr.len <= ifp->if_mtu) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		nd6_output(ifp, ifp, m0, dst, NULL);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 	} else {
+ 		in6_ifstat_inc(ifp, ifs6_in_toobig);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (r->rt != PF_DUPTO) {
+ 			PF_UNLOCK();
+ 			icmp6_error(m0, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu);
+@@ -6340,7 +6340,7 @@
+ }
+ #endif /* INET6 */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ /*
+  * FreeBSD supports cksum offloads for the following drivers.
+  *  em(4), fxp(4), ixgb(4), lge(4), ndis(4), nge(4), re(4),
+@@ -6570,7 +6570,7 @@
+ }
+ #endif
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ struct pf_divert *
+ pf_find_divert(struct mbuf *m)
+ {
+@@ -6602,7 +6602,7 @@
+ 
+ #ifdef INET
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0,
+     struct ether_header *eh, struct inpcb *inp)
+ #else
+@@ -6613,7 +6613,7 @@
+ 	struct pfi_kif		*kif;
+ 	u_short			 action, reason = 0, log = 0;
+ 	struct mbuf		*m = *m0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ip		*h = NULL;
+ 	struct m_tag		*ipfwtag;
+ 	struct pf_rule		*a = NULL, *r = &V_pf_default_rule, *tr, *nr;
+@@ -6626,7 +6626,7 @@
+ 	struct pf_pdesc		 pd;
+ 	int			 off, dirndx, pqid = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ 	if (!V_pf_status.running)
+ 	{
+@@ -6639,7 +6639,7 @@
+ #endif
+ 
+ 	memset(&pd, 0, sizeof(pd));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((pd.pf_mtag = pf_get_mtag(m)) == NULL) {
+ 		PF_UNLOCK();
+ 		DPFPRINTF(PF_DEBUG_URGENT,
+@@ -6647,7 +6647,7 @@
+ 		return (PF_DROP);
+ 	}
+ #endif
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	if (ifp->if_type == IFT_CARP && ifp->if_carpdev)
+ 		kif = (struct pfi_kif *)ifp->if_carpdev->if_pf_kif;
+ 	else
+@@ -6655,7 +6655,7 @@
+ 		kif = (struct pfi_kif *)ifp->if_pf_kif;
+ 
+ 	if (kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		DPFPRINTF(PF_DEBUG_URGENT,
+@@ -6663,16 +6663,16 @@
+ 		return (PF_DROP);
+ 	}
+ 	if (kif->pfik_flags & PFI_IFLAG_SKIP)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		PF_UNLOCK();
+ #endif
+ 		return (PF_PASS);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	}
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	M_ASSERTPKTHDR(m);
+ #else
+ #ifdef DIAGNOSTIC
+@@ -6688,7 +6688,7 @@
+ 		goto done;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (m->m_flags & M_SKIP_FIREWALL) {
+ 		PF_UNLOCK();
+ 		return (PF_PASS);
+@@ -6698,7 +6698,7 @@
+ 		return (PF_PASS);
+ #endif
+ 	
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (ip_divert_ptr != NULL &&
+ 	    ((ipfwtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL)) != NULL)) {
+ 		struct ipfw_rule_ref *rr = (struct ipfw_rule_ref *)(ipfwtag+1);
+@@ -6770,7 +6770,7 @@
+ 		    &reason);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -6781,7 +6781,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -6810,7 +6810,7 @@
+ 		action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -6821,7 +6821,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -6844,7 +6844,7 @@
+ 		    &reason);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -6855,7 +6855,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -6878,7 +6878,7 @@
+ 		action = pf_test_state_other(&s, dir, kif, m, &pd);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -6889,7 +6889,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif, m, off, h,
+ 			    &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -6910,14 +6910,14 @@
+ 	}
+ 
+ 	if ((s && s->tag) || r->rtableid)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag);
+ #else
+ 		pf_tag_packet(m, s ? s->tag : 0, r->rtableid);
+ #endif
+ 
+ 	if (dir == PF_IN && s && s->key[PF_SK_STACK])
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pd.pf_mtag->statekey = s->key[PF_SK_STACK];
+ #else
+ 		m->m_pkthdr.pf.statekey = s->key[PF_SK_STACK];
+@@ -6925,7 +6925,7 @@
+ 
+ #ifdef ALTQ
+ 	if (action == PF_PASS && r->qid) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pqid || (pd.tos & IPTOS_LOWDELAY))
+ 			pd.pf_mtag->qid = r->pqid;
+ 		else
+@@ -6954,13 +6954,13 @@
+ 	    (s->nat_rule.ptr->action == PF_RDR ||
+ 	    s->nat_rule.ptr->action == PF_BINAT) &&
+ 	    (ntohl(pd.dst->v4.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m->m_flags |= M_SKIP_FIREWALL;
+ #else
+ 		m->m_pkthdr.pf.flags |= PF_TAG_TRANSLATE_LOCALHOST;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (action == PF_PASS && r->divert.port &&
+ 	    ip_divert_ptr != NULL && !PACKET_LOOPED()) {
+ 
+@@ -7047,7 +7047,7 @@
+ 		}
+ 		tr = r;
+ 		nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (nr != NULL && r == &V_pf_default_rule)
+ #else
+ 		if (nr != NULL && r == &pf_default_rule)
+@@ -7082,7 +7082,7 @@
+ 			pf_route(m0, r, dir, kif->pfik_ifp, s, &pd);
+ 		break;
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	return (action);
+@@ -7091,7 +7091,7 @@
+ 
+ #ifdef INET6
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0,
+     struct ether_header *eh, struct inpcb *inp)
+ #else
+@@ -7102,7 +7102,7 @@
+ 	struct pfi_kif		*kif;
+ 	u_short			 action, reason = 0, log = 0;
+ 	struct mbuf		*m = *m0, *n = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ip6_hdr		*h = NULL;
+ 	struct pf_rule		*a = NULL, *r = &V_pf_default_rule, *tr, *nr;
+ #else
+@@ -7114,7 +7114,7 @@
+ 	struct pf_pdesc		 pd;
+ 	int			 off, terminal = 0, dirndx, rh_cnt = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ 	if (!V_pf_status.running) {
+ 		PF_UNLOCK();
+@@ -7126,7 +7126,7 @@
+ #endif
+ 
+ 	memset(&pd, 0, sizeof(pd));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((pd.pf_mtag = pf_get_mtag(m)) == NULL) {
+ 		PF_UNLOCK();
+ 		DPFPRINTF(PF_DEBUG_URGENT,
+@@ -7134,7 +7134,7 @@
+ 		return (PF_DROP);
+ 	}
+ #endif
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	if (ifp->if_type == IFT_CARP && ifp->if_carpdev)
+ 		kif = (struct pfi_kif *)ifp->if_carpdev->if_pf_kif;
+ 	else
+@@ -7142,7 +7142,7 @@
+ 		kif = (struct pfi_kif *)ifp->if_pf_kif;
+ 
+ 	if (kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		DPFPRINTF(PF_DEBUG_URGENT,
+@@ -7150,16 +7150,16 @@
+ 		return (PF_DROP);
+ 	}
+ 	if (kif->pfik_flags & PFI_IFLAG_SKIP)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	{
+ 		PF_UNLOCK();
+ #endif
+ 		return (PF_PASS);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	}
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	M_ASSERTPKTHDR(m);
+ #else
+ #ifdef DIAGNOSTIC
+@@ -7175,14 +7175,14 @@
+ 		goto done;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pd.pf_mtag->flags & PF_TAG_GENERATED) {
+ 		PF_UNLOCK();
+ #else
+ 	if (m->m_pkthdr.pf.flags & PF_TAG_GENERATED)
+ #endif
+ 		return (PF_PASS);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	}
+ #endif
+ 
+@@ -7310,7 +7310,7 @@
+ 		    &reason);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -7321,7 +7321,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -7350,7 +7350,7 @@
+ 		action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -7361,7 +7361,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -7391,7 +7391,7 @@
+ 		    m, off, h, &pd, &reason);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -7402,7 +7402,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif,
+ 			    m, off, h, &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -7416,7 +7416,7 @@
+ 		action = pf_test_state_other(&s, dir, kif, m, &pd);
+ 		if (action == PF_PASS) {
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (pfsync_update_state_ptr != NULL)
+ 				pfsync_update_state_ptr(s);
+ #else
+@@ -7427,7 +7427,7 @@
+ 			a = s->anchor.ptr;
+ 			log = s->log;
+ 		} else if (s == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			action = pf_test_rule(&r, &s, dir, kif, m, off, h,
+ 			    &pd, &a, &ruleset, NULL, inp);
+ #else
+@@ -7454,14 +7454,14 @@
+ 	}
+ 
+ 	if ((s && s->tag) || r->rtableid)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag);
+ #else
+ 		pf_tag_packet(m, s ? s->tag : 0, r->rtableid);
+ #endif
+ 
+ 	if (dir == PF_IN && s && s->key[PF_SK_STACK])
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pd.pf_mtag->statekey = s->key[PF_SK_STACK];
+ #else
+ 		m->m_pkthdr.pf.statekey = s->key[PF_SK_STACK];
+@@ -7469,7 +7469,7 @@
+ 
+ #ifdef ALTQ
+ 	if (action == PF_PASS && r->qid) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pd.tos & IPTOS_LOWDELAY)
+ 			pd.pf_mtag->qid = r->pqid;
+ 		else
+@@ -7492,13 +7492,13 @@
+ 	    (s->nat_rule.ptr->action == PF_RDR ||
+ 	    s->nat_rule.ptr->action == PF_BINAT) &&
+ 	    IN6_IS_ADDR_LOOPBACK(&pd.dst->v6))
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m->m_flags |= M_SKIP_FIREWALL;
+ #else
+ 		m->m_pkthdr.pf.flags |= PF_TAG_TRANSLATE_LOCALHOST;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX: Anybody working on it?! */
+ 	if (r->divert.port)
+ 		printf("pf: divert(9) is not supported for IPv6\n");
+@@ -7556,7 +7556,7 @@
+ 		}
+ 		tr = r;
+ 		nr = (s != NULL) ? s->nat_rule.ptr : pd.nat_rule;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (nr != NULL && r == &V_pf_default_rule)
+ #else
+ 		if (nr != NULL && r == &pf_default_rule)
+@@ -7590,7 +7590,7 @@
+ 		break;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ #endif
+ 	return (action);
+@@ -7600,7 +7600,7 @@
+ int
+ pf_check_congestion(struct ifqueue *ifq)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX_IMPORT: later */
+ 	return (0);
+ #else
+@@ -7618,7 +7618,7 @@
+ void
+ pf_pkt_addr_changed(struct mbuf *m)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pf_mtag	*pf_tag;
+ 
+ 	if ((pf_tag = pf_find_mtag(m)) != NULL)
+--- a/sys/contrib/pf/net/pf_if.c
++++ b/sys/contrib/pf/net/pf_if.c
+@@ -32,7 +32,7 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD_kernel__)
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ 
+@@ -42,7 +42,7 @@
+ 
+ #include <sys/param.h>
+ #include <sys/systm.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/malloc.h>
+ #endif
+ #include <sys/mbuf.h>
+@@ -50,17 +50,17 @@
+ #include <sys/socket.h>
+ #include <sys/socketvar.h>
+ #include <sys/kernel.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/device.h>
+ #endif
+ #include <sys/time.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/pool.h>
+ #endif
+ 
+ #include <net/if.h>
+ #include <net/if_types.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <net/vnet.h>
+ #endif
+ 
+@@ -76,7 +76,7 @@
+ #include <netinet/ip6.h>
+ #endif /* INET6 */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(struct pfi_kif *,	 pfi_all);
+ VNET_DEFINE(uma_zone_t,		 pfi_addr_pl);
+ VNET_DEFINE(struct pfi_ifhead,	 pfi_ifs);
+@@ -98,7 +98,7 @@
+ int			  pfi_buffer_cnt;
+ int			  pfi_buffer_max;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ eventhandler_tag	 pfi_attach_cookie;
+ eventhandler_tag	 pfi_detach_cookie;
+ eventhandler_tag	 pfi_attach_group_cookie;
+@@ -117,7 +117,7 @@
+ int		 pfi_if_compare(struct pfi_kif *, struct pfi_kif *);
+ int		 pfi_skip_if(const char *, struct pfi_kif *);
+ int		 pfi_unmask(void *);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void		 pfi_attach_ifnet_event(void * __unused, struct ifnet *);
+ void		 pfi_detach_ifnet_event(void * __unused, struct ifnet *);
+ void		 pfi_attach_group_event(void *, struct ifg_group *);
+@@ -135,18 +135,18 @@
+ void
+ pfi_initialize(void)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pfi_all != NULL)	/* already initialized */
+ #else
+ 	if (pfi_all != NULL)	/* already initialized */
+ #endif
+ 		return;
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	pool_init(&V_pfi_addr_pl, sizeof(struct pfi_dynaddr), 0, 0, 0,
+ 	    "pfiaddrpl", &pool_allocator_nointr);
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_buffer_max = 64;
+ 	V_pfi_buffer = malloc(V_pfi_buffer_max * sizeof(*V_pfi_buffer),
+ 	    PFI_MTYPE, M_WAITOK);
+@@ -160,7 +160,7 @@
+ 	if ((pfi_all = pfi_kif_get(IFG_ALL)) == NULL)
+ #endif
+ 		panic("pfi_kif_get for pfi_all failed");
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct ifg_group *ifg;
+ 	struct ifnet *ifp;
+ 
+@@ -186,7 +186,7 @@
+ #endif
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ pfi_cleanup(void)
+ {
+@@ -224,7 +224,7 @@
+ 
+ 	bzero(&s, sizeof(s));
+ 	strlcpy(s.pfik_name, kif_name, sizeof(s.pfik_name));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((kif = RB_FIND(pfi_ifhead, &V_pfi_ifs, (struct pfi_kif *)&s)) != NULL)
+ #else
+ 	if ((kif = RB_FIND(pfi_ifhead, &pfi_ifs, (struct pfi_kif *)&s)) != NULL)
+@@ -232,7 +232,7 @@
+ 		return (kif);
+ 
+ 	/* create new one */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((kif = malloc(sizeof(*kif), PFI_MTYPE, M_NOWAIT | M_ZERO)) == NULL)
+ #else
+ 	if ((kif = malloc(sizeof(*kif), PFI_MTYPE, M_DONTWAIT|M_ZERO)) == NULL)
+@@ -240,7 +240,7 @@
+ 		return (NULL);
+ 
+ 	strlcpy(kif->pfik_name, kif_name, sizeof(kif->pfik_name));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/*
+ 	 * It seems that the value of time_second is in unintialzied state
+ 	 * when pf sets interface statistics clear time in boot phase if pf
+@@ -254,7 +254,7 @@
+ #endif
+ 	TAILQ_INIT(&kif->pfik_dynaddrs);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_INSERT(pfi_ifhead, &V_pfi_ifs, kif);
+ #else
+ 	RB_INSERT(pfi_ifhead, &pfi_ifs, kif);
+@@ -305,7 +305,7 @@
+ 		panic("pfi_kif_unref with unknown type");
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (kif->pfik_ifp != NULL || kif->pfik_group != NULL || kif == V_pfi_all)
+ #else
+ 	if (kif->pfik_ifp != NULL || kif->pfik_group != NULL || kif == pfi_all)
+@@ -315,7 +315,7 @@
+ 	if (kif->pfik_rules || kif->pfik_states)
+ 		return;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif);
+ #else
+ 	RB_REMOVE(pfi_ifhead, &pfi_ifs, kif);
+@@ -347,7 +347,7 @@
+ 
+ 	pfi_initialize();
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+@@ -358,7 +358,7 @@
+ 	kif->pfik_ifp = ifp;
+ 	ifp->if_pf_kif = (caddr_t)kif;
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	if ((kif->pfik_ah_cookie = hook_establish(ifp->if_addrhooks, 1,
+ 	    pfi_kifaddr_update, kif)) == NULL)
+ 		panic("pfi_attach_ifnet: cannot allocate '%s' address hook",
+@@ -380,12 +380,12 @@
+ 		return;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+ #endif
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	hook_disestablish(ifp->if_addrhooks, kif->pfik_ah_cookie);
+ #endif
+ 	pfi_kif_update(kif);
+@@ -404,7 +404,7 @@
+ 
+ 	pfi_initialize();
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+@@ -428,7 +428,7 @@
+ 		return;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+@@ -447,7 +447,7 @@
+ 	int			 s;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+@@ -505,7 +505,7 @@
+ 
+ 	if (aw->type != PF_ADDR_DYNIFTL)
+ 		return (0);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX: revisit! */
+ 	if ((dyn = pool_get(&V_pfi_addr_pl, PR_WAITOK | PR_ZERO))
+ #else
+@@ -567,7 +567,7 @@
+ 		pf_remove_if_empty_ruleset(ruleset);
+ 	if (dyn->pfid_kif != NULL)
+ 		pfi_kif_unref(dyn->pfid_kif, PFI_KIF_REF_RULE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pfi_addr_pl, dyn);
+ #else
+ 	pool_put(&pfi_addr_pl, dyn);
+@@ -605,14 +605,14 @@
+ 	kif = dyn->pfid_kif;
+ 	kt = dyn->pfid_kt;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (kt->pfrkt_larg != V_pfi_update) {
+ #else
+ 	if (kt->pfrkt_larg != pfi_update) {
+ #endif
+ 		/* this table needs to be brought up-to-date */
+ 		pfi_table_update(kt, kif, dyn->pfid_net, dyn->pfid_iflags);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt->pfrkt_larg = V_pfi_update;
+ #else
+ 		kt->pfrkt_larg = pfi_update;
+@@ -627,7 +627,7 @@
+ 	int			 e, size2 = 0;
+ 	struct ifg_member	*ifgm;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_buffer_cnt = 0;
+ #else
+ 	pfi_buffer_cnt = 0;
+@@ -639,7 +639,7 @@
+ 		TAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, ifgm_next)
+ 			pfi_instance_add(ifgm->ifgm_ifp, net, flags);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((e = pfr_set_addrs(&kt->pfrkt_t, V_pfi_buffer, V_pfi_buffer_cnt, &size2,
+ 	    NULL, NULL, NULL, 0, PFR_TFLAG_ALLMASK)))
+ 		printf("pfi_table_update: cannot set %d new addresses "
+@@ -667,7 +667,7 @@
+ 		af = ia->ifa_addr->sa_family;
+ 		if (af != AF_INET && af != AF_INET6)
+ 			continue;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		/*
+ 		 * XXX: For point-to-point interfaces, (ifname:0) and IPv4,
+ 		 *      jump over addresses without a proper route to work
+@@ -727,7 +727,7 @@
+ 	struct pfr_addr	*p;
+ 	int		 i;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pfi_buffer_cnt >= V_pfi_buffer_max) {
+ 		int		 new_max = V_pfi_buffer_max * 2;
+ #else
+@@ -737,7 +737,7 @@
+ 
+ 		if (new_max > PFI_BUFFER_MAX) {
+ 			printf("pfi_address_add: address buffer full (%d/%d)\n",
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    V_pfi_buffer_cnt, PFI_BUFFER_MAX);
+ #else
+ 			    pfi_buffer_cnt, PFI_BUFFER_MAX);
+@@ -745,21 +745,21 @@
+ 			return;
+ 		}
+ 		p = malloc(new_max * sizeof(*V_pfi_buffer), PFI_MTYPE,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    M_NOWAIT);
+ #else
+ 		    M_DONTWAIT);
+ #endif
+ 		if (p == NULL) {
+ 			printf("pfi_address_add: no memory to grow buffer "
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    "(%d/%d)\n", V_pfi_buffer_cnt, PFI_BUFFER_MAX);
+ #else
+ 			    "(%d/%d)\n", pfi_buffer_cnt, PFI_BUFFER_MAX);
+ #endif
+ 			return;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		memcpy(V_pfi_buffer, p, V_pfi_buffer_cnt * sizeof(*V_pfi_buffer));
+ 		/* no need to zero buffer */
+ 		free(V_pfi_buffer, PFI_MTYPE);
+@@ -775,7 +775,7 @@
+ 	}
+ 	if (af == AF_INET && net > 32)
+ 		net = 128;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	p = V_pfi_buffer + V_pfi_buffer_cnt++;
+ #else
+ 	p = pfi_buffer + pfi_buffer_cnt++;
+@@ -812,7 +812,7 @@
+ 	aw->p.dyn->pfid_kif = NULL;
+ 	pfr_detach_table(aw->p.dyn->pfid_kt);
+ 	aw->p.dyn->pfid_kt = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pfi_addr_pl, aw->p.dyn);
+ #else
+ 	pool_put(&pfi_addr_pl, aw->p.dyn);
+@@ -837,7 +837,7 @@
+ 	struct pfi_kif		*kif = (struct pfi_kif *)v;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_pfi_update++;
+ #else
+ 	pfi_update++;
+@@ -863,7 +863,7 @@
+ 
+ 	strlcpy(key.pfik_name, name, sizeof(key.pfik_name));
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	p = RB_FIND(pfi_ifhead, &V_pfi_ifs, (struct pfi_kif *)&key);
+ #else
+ 	p = RB_FIND(pfi_ifhead, &pfi_ifs, (struct pfi_kif *)&key);
+@@ -915,12 +915,12 @@
+ {
+ 	struct pfi_kif	*p, *nextp;
+ 	int		 s, n = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	int		 error;
+ #endif
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	for (p = RB_MIN(pfi_ifhead, &V_pfi_ifs); p; p = nextp) {
+ 		nextp = RB_NEXT(pfi_ifhead, &V_pfi_ifs, p);
+ #else
+@@ -933,7 +933,7 @@
+ 			if (!p->pfik_tzero)
+ 				p->pfik_tzero = time_second;
+ 			pfi_kif_ref(p, PFI_KIF_REF_RULE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYOUT(p, buf++, sizeof(*buf), error);
+ 			if (error) {
+ #else
+@@ -943,7 +943,7 @@
+ 				splx(s);
+ 				return (EFAULT);
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			nextp = RB_NEXT(pfi_ifhead, &V_pfi_ifs, p);
+ #else
+ 			nextp = RB_NEXT(pfi_ifhead, &pfi_ifs, p);
+@@ -982,7 +982,7 @@
+ 	int		 s;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) {
+ #else
+ 	RB_FOREACH(p, pfi_ifhead, &pfi_ifs) {
+@@ -1002,7 +1002,7 @@
+ 	int		 s;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_FOREACH(p, pfi_ifhead, &V_pfi_ifs) {
+ #else
+ 	RB_FOREACH(p, pfi_ifhead, &pfi_ifs) {
+@@ -1035,7 +1035,7 @@
+ 	return (b);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ pfi_attach_ifnet_event(void *arg __unused, struct ifnet *ifp)
+ {
+--- a/sys/contrib/pf/net/pf_ioctl.c
++++ b/sys/contrib/pf/net/pf_ioctl.c
+@@ -35,7 +35,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
+@@ -76,7 +76,7 @@
+ #include <sys/socketvar.h>
+ #include <sys/kernel.h>
+ #include <sys/time.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/ucred.h>
+ #include <sys/jail.h>
+ #include <sys/module.h>
+@@ -90,14 +90,14 @@
+ #include <sys/proc.h>
+ #include <sys/malloc.h>
+ #include <sys/kthread.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/rwlock.h>
+ #include <uvm/uvm_extern.h>
+ #endif
+ 
+ #include <net/if.h>
+ #include <net/if_types.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <net/vnet.h>
+ #endif
+ #include <net/route.h>
+@@ -109,7 +109,7 @@
+ #include <netinet/ip_var.h>
+ #include <netinet/ip_icmp.h>
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/md5.h>
+ #else
+ #include <dev/rndvar.h>
+@@ -132,14 +132,14 @@
+ #include <altq/altq.h>
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/limits.h>
+ #include <sys/lock.h>
+ #include <sys/mutex.h>
+ #include <net/pfil.h>
+ #endif /* __FreeBSD__ */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void			 init_zone_var(void);
+ void			 cleanup_pf_zone(void);
+ int			 pfattach(void);
+@@ -154,7 +154,7 @@
+ 
+ void			 pf_mv_pool(struct pf_palist *, struct pf_palist *);
+ void			 pf_empty_pool(struct pf_palist *);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int			 pfioctl(struct cdev *, u_long, caddr_t, int, struct thread *);
+ #else
+ int			 pfioctl(dev_t, u_long, caddr_t, int, struct proc *);
+@@ -178,7 +178,7 @@
+ 
+ #define	TAGID_MAX	 50000
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(struct pf_rule,	 pf_default_rule);
+ VNET_DEFINE(struct sx,		 pf_consistency_lock);
+ 
+@@ -216,13 +216,13 @@
+ void			 pf_rtlabel_remove(struct pf_addr_wrap *);
+ void			 pf_rtlabel_copyout(struct pf_addr_wrap *);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
+ #else
+ #define DPFPRINTF(n, x) if (pf_status.debug >= (n)) printf x
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ struct cdev *pf_dev;
+  
+ /*
+@@ -607,7 +607,7 @@
+ 		pf_tbladdr_remove(&empty_pool_pa->addr);
+ 		pfi_kif_unref(empty_pool_pa->kif, PFI_KIF_REF_RULE);
+ 		TAILQ_REMOVE(poola, empty_pool_pa, entries);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_pooladdr_pl, empty_pool_pa);
+ #else
+ 		pool_put(&pf_pooladdr_pl, empty_pool_pa);
+@@ -658,7 +658,7 @@
+ 	pfi_kif_unref(rule->kif, PFI_KIF_REF_RULE);
+ 	pf_anchor_remove(rule);
+ 	pf_empty_pool(&rule->rpool.list);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pf_rule_pl, rule);
+ #else
+ 	pool_put(&pf_rule_pl, rule);
+@@ -743,7 +743,7 @@
+ u_int16_t
+ pf_tagname2tag(char *tagname)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	return (tagname2tag(&V_pf_tags, tagname));
+ #else
+ 	return (tagname2tag(&pf_tags, tagname));
+@@ -753,7 +753,7 @@
+ void
+ pf_tag2tagname(u_int16_t tagid, char *p)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	tag2tagname(&V_pf_tags, tagid, p);
+ #else
+ 	tag2tagname(&pf_tags, tagid, p);
+@@ -765,7 +765,7 @@
+ {
+ 	struct pf_tagname *t;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_FOREACH(t, &V_pf_tags, entries)
+ #else
+ 	TAILQ_FOREACH(t, &pf_tags, entries)
+@@ -779,7 +779,7 @@
+ void
+ pf_tag_unref(u_int16_t tag)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	tag_unref(&V_pf_tags, tag);
+ #else
+ 	tag_unref(&pf_tags, tag);
+@@ -789,7 +789,7 @@
+ int
+ pf_rtlabel_add(struct pf_addr_wrap *a)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX_IMPORT: later */
+ 	return (0);
+ #else
+@@ -803,7 +803,7 @@
+ void
+ pf_rtlabel_remove(struct pf_addr_wrap *a)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX_IMPORT: later */
+ #else
+ 	if (a->type == PF_ADDR_RTLABEL)
+@@ -814,7 +814,7 @@
+ void
+ pf_rtlabel_copyout(struct pf_addr_wrap *a)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/* XXX_IMPORT: later */
+ 	if (a->type == PF_ADDR_RTLABEL && a->v.rtlabel)
+ 		strlcpy(a->v.rtlabelname, "?", sizeof(a->v.rtlabelname));
+@@ -836,7 +836,7 @@
+ u_int32_t
+ pf_qname2qid(char *qname)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	return ((u_int32_t)tagname2tag(&V_pf_qids, qname));
+ #else
+ 	return ((u_int32_t)tagname2tag(&pf_qids, qname));
+@@ -846,7 +846,7 @@
+ void
+ pf_qid2qname(u_int32_t qid, char *p)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	tag2tagname(&V_pf_qids, (u_int16_t)qid, p);
+ #else
+ 	tag2tagname(&pf_qids, (u_int16_t)qid, p);
+@@ -856,7 +856,7 @@
+ void
+ pf_qid_unref(u_int32_t qid)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	tag_unref(&V_pf_qids, (u_int16_t)qid);
+ #else
+ 	tag_unref(&pf_qids, (u_int16_t)qid);
+@@ -870,7 +870,7 @@
+ 	int		 error = 0;
+ 
+ 	/* Purge the old altq list */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while ((altq = TAILQ_FIRST(V_pf_altqs_inactive)) != NULL) {
+ 		TAILQ_REMOVE(V_pf_altqs_inactive, altq, entries);
+ 		if (altq->qname[0] == 0 &&
+@@ -884,7 +884,7 @@
+ 			error = altq_remove(altq);
+ 		} else
+ 			pf_qid_unref(altq->qid);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_altq_pl, altq);
+ #else
+ 		pool_put(&pf_altq_pl, altq);
+@@ -892,7 +892,7 @@
+ 	}
+ 	if (error)
+ 		return (error);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	*ticket = ++V_ticket_altqs_inactive;
+ 	V_altqs_inactive_open = 1;
+ #else
+@@ -908,7 +908,7 @@
+ 	struct pf_altq	*altq;
+ 	int		 error = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!V_altqs_inactive_open || ticket != V_ticket_altqs_inactive)
+ 		return (0);
+ 	/* Purge the old altq list */
+@@ -928,13 +928,13 @@
+ 			error = altq_remove(altq);
+ 		} else
+ 			pf_qid_unref(altq->qid);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_altq_pl, altq);
+ #else
+ 		pool_put(&pf_altq_pl, altq);
+ #endif
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_altqs_inactive_open = 0;
+ #else
+ 	altqs_inactive_open = 0;
+@@ -949,7 +949,7 @@
+ 	struct pf_altq		*altq;
+ 	int			 s, err, error = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (!V_altqs_inactive_open || ticket != V_ticket_altqs_inactive)
+ #else
+ 	if (!altqs_inactive_open || ticket != ticket_altqs_inactive)
+@@ -958,7 +958,7 @@
+ 
+ 	/* swap altqs, keep the old. */
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	old_altqs = V_pf_altqs_active;
+ 	V_pf_altqs_active = V_pf_altqs_inactive;
+ 	V_pf_altqs_inactive = old_altqs;
+@@ -971,7 +971,7 @@
+ #endif
+ 
+ 	/* Attach new disciplines */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_FOREACH(altq, V_pf_altqs_active, entries) {
+ 	if (altq->qname[0] == 0 &&
+ 	   (altq->local_flags & PFALTQ_FLAG_IF_REMOVED) == 0) {
+@@ -981,7 +981,7 @@
+ #endif
+ 			/* attach the discipline */
+ 			error = altq_pfattach(altq);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (error == 0 && V_pf_altq_running)
+ #else
+ 			if (error == 0 && pf_altq_running)
+@@ -995,7 +995,7 @@
+ 	}
+ 
+ 	/* Purge the old altq list */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while ((altq = TAILQ_FIRST(V_pf_altqs_inactive)) != NULL) {
+ 		TAILQ_REMOVE(V_pf_altqs_inactive, altq, entries);
+ 		if (altq->qname[0] == 0 &&
+@@ -1006,7 +1006,7 @@
+ 		if (altq->qname[0] == 0) {
+ #endif
+ 			/* detach and destroy the discipline */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_altq_running)
+ #else
+ 			if (pf_altq_running)
+@@ -1020,7 +1020,7 @@
+ 				error = err;
+ 		} else
+ 			pf_qid_unref(altq->qid);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_altq_pl, altq);
+ #else
+ 		pool_put(&pf_altq_pl, altq);
+@@ -1028,7 +1028,7 @@
+ 	}
+ 	splx(s);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	V_altqs_inactive_open = 0;
+ #else
+ 	altqs_inactive_open = 0;
+@@ -1054,11 +1054,11 @@
+ 		tb.rate = altq->ifbandwidth;
+ 		tb.depth = altq->tbrsize;
+ 		s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		error = tbr_set(&ifp->if_snd, &tb);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		splx(s);
+@@ -1090,11 +1090,11 @@
+ 		/* clear tokenbucket regulator */
+ 		tb.rate = 0;
+ 		s = splnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		error = tbr_set(&ifp->if_snd, &tb);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		splx(s);
+@@ -1103,7 +1103,7 @@
+ 	return (error);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ pf_altq_ifnet_event(struct ifnet *ifp, int remove)
+ {
+@@ -1113,7 +1113,7 @@
+ 	int		 error = 0;
+ 
+ 	/* Interrupt userland queue modifications */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_altqs_inactive_open)
+ 		pf_rollback_altq(V_ticket_altqs_inactive);
+ #else
+@@ -1126,7 +1126,7 @@
+ 		return;
+ 
+ 	/* Copy the current active set */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_FOREACH(a1, V_pf_altqs_active, entries) {
+ 		a2 = pool_get(&V_pf_altq_pl, PR_NOWAIT);
+ #else
+@@ -1142,7 +1142,7 @@
+ 		if (a2->qname[0] != 0) {
+ 			if ((a2->qid = pf_qname2qid(a2->qname)) == 0) {
+ 				error = EBUSY;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_altq_pl, a2);
+ #else
+ 				pool_put(&pf_altq_pl, a2);
+@@ -1150,7 +1150,7 @@
+ 				break;
+ 			}
+ 			a2->altq_disc = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			TAILQ_FOREACH(a3, V_pf_altqs_inactive, entries) {
+ #else
+ 			TAILQ_FOREACH(a3, pf_altqs_inactive, entries) {
+@@ -1172,7 +1172,7 @@
+ 			error = altq_add(a2);
+ 			PF_LOCK();
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (ticket != V_ticket_altqs_inactive)
+ #else
+ 			if (ticket != ticket_altqs_inactive)
+@@ -1180,7 +1180,7 @@
+ 				error = EBUSY;
+ 
+ 			if (error) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_altq_pl, a2);
+ #else
+ 				pool_put(&pf_altq_pl, a2);
+@@ -1189,7 +1189,7 @@
+ 			}
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_INSERT_TAIL(V_pf_altqs_inactive, a2, entries);
+ #else
+ 		TAILQ_INSERT_TAIL(pf_altqs_inactive, a2, entries);
+@@ -1420,7 +1420,7 @@
+ 	}
+ 
+ 	MD5Final(digest, &ctx);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	memcpy(V_pf_status.pf_chksum, digest, sizeof(V_pf_status.pf_chksum));
+ #else
+ 	memcpy(pf_status.pf_chksum, digest, sizeof(pf_status.pf_chksum));
+@@ -1448,7 +1448,7 @@
+ }
+ 
+ int
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+ #else
+ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
+@@ -1456,7 +1456,7 @@
+ {
+ 	struct pf_pooladdr	*pa = NULL;
+ 	struct pf_pool		*pool = NULL;
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	int			 s;
+ #endif
+ 	int			 error = 0;
+@@ -1464,7 +1464,7 @@
+ 	CURVNET_SET(TD_TO_VNET(td));
+ 
+ 	/* XXX keep in sync with switch() below */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (securelevel_gt(td->td_ucred, 2))
+ #else
+ 	if (securelevel > 1)
+@@ -1504,7 +1504,7 @@
+ 		case DIOCGETSRCNODES:
+ 		case DIOCCLRSRCNODES:
+ 		case DIOCIGETIFACES:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		case DIOCGIFSPEED:
+ #endif
+ 		case DIOCSETIFFLAG:
+@@ -1546,7 +1546,7 @@
+ 		case DIOCOSFPGET:
+ 		case DIOCGETSRCNODES:
+ 		case DIOCIGETIFACES:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		case DIOCGIFSPEED:
+ #endif
+ 			break;
+@@ -1575,7 +1575,7 @@
+ 		}
+ 
+ 	if (flags & FWRITE)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		sx_xlock(&V_pf_consistency_lock);
+ 	else
+ 		sx_slock(&V_pf_consistency_lock);
+@@ -1585,7 +1585,7 @@
+ 		rw_enter_read(&pf_consistency_lock);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK();
+ #else
+ 	s = splsoftnet();
+@@ -1593,14 +1593,14 @@
+ 	switch (cmd) {
+ 
+ 	case DIOCSTART:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.running)
+ #else
+ 		if (pf_status.running)
+ #endif
+ 			error = EEXIST;
+ 		else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_UNLOCK();
+ 			error = hook_pf();
+ 			PF_LOCK();
+@@ -1630,7 +1630,7 @@
+ 		break;
+ 
+ 	case DIOCSTOP:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (!V_pf_status.running)
+ 			error = ENOENT;
+ 		else {
+@@ -1678,7 +1678,7 @@
+ 			break;
+ 		}
+ 		if (pr->ticket != ruleset->rules[rs_num].inactive.ticket) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			DPFPRINTF(PF_DEBUG_MISC,
+ 			    ("ticket: %d != [%d]%d\n", pr->ticket, rs_num,
+ 			    ruleset->rules[rs_num].inactive.ticket));
+@@ -1686,7 +1686,7 @@
+ 			error = EBUSY;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pr->pool_ticket != V_ticket_pabuf) {
+ 			DPFPRINTF(PF_DEBUG_MISC,
+ 			    ("pool_ticket: %d != %d\n", pr->pool_ticket,
+@@ -1697,7 +1697,7 @@
+ 			error = EBUSY;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rule = pool_get(&V_pf_rule_pl, PR_NOWAIT);
+ #else
+ 		rule = pool_get(&pf_rule_pl, PR_WAITOK|PR_LIMITFAIL);
+@@ -1707,7 +1707,7 @@
+ 			break;
+ 		}
+ 		bcopy(&pr->rule, rule, sizeof(struct pf_rule));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rule->cuid = td->td_ucred->cr_ruid;
+ 		rule->cpid = td->td_proc ? td->td_proc->p_pid : 0;
+ #else
+@@ -1723,7 +1723,7 @@
+ 		rule->entries.tqe_prev = NULL;
+ #ifndef INET
+ 		if (rule->af == AF_INET) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_rule_pl, rule);
+ #else
+ 			pool_put(&pf_rule_pl, rule);
+@@ -1734,7 +1734,7 @@
+ #endif /* INET */
+ #ifndef INET6
+ 		if (rule->af == AF_INET6) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_rule_pl, rule);
+ #else
+ 			pool_put(&pf_rule_pl, rule);
+@@ -1752,7 +1752,7 @@
+ 		if (rule->ifname[0]) {
+ 			rule->kif = pfi_kif_get(rule->ifname);
+ 			if (rule->kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_rule_pl, rule);
+ #else
+ 				pool_put(&pf_rule_pl, rule);
+@@ -1763,7 +1763,7 @@
+ 			pfi_kif_ref(rule->kif, PFI_KIF_REF_RULE);
+ 		}
+ 
+-#ifdef __FreeBSD__ /* ROUTING */
++#ifdef __FreeBSD_kernel__ /* ROUTING */
+ 		if (rule->rtableid > 0 && rule->rtableid > rt_numfibs)
+ #else
+ 		if (rule->rtableid > 0 && !rtable_exists(rule->rtableid))
+@@ -1807,7 +1807,7 @@
+ 			error = EINVAL;
+ 		if (pf_anchor_setup(rule, ruleset, pr->anchor_call))
+ 			error = EINVAL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_FOREACH(pa, &V_pf_pabuf, entries)
+ #else
+ 		TAILQ_FOREACH(pa, &pf_pabuf, entries)
+@@ -1824,7 +1824,7 @@
+ 				    PFR_TFLAG_ACTIVE;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_mv_pool(&V_pf_pabuf, &rule->rpool.list);
+ #else
+ 		pf_mv_pool(&pf_pabuf, &rule->rpool.list);
+@@ -1840,7 +1840,7 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (!V_debug_pfugidhack && (rule->uid.op || rule->gid.op ||
+ 		    rule->log & PF_LOG_SOCKET_LOOKUP)) {
+ 			DPFPRINTF(PF_DEBUG_MISC,
+@@ -1944,7 +1944,7 @@
+ 
+ 		if (!(pcr->action == PF_CHANGE_REMOVE ||
+ 		    pcr->action == PF_CHANGE_GET_TICKET) &&
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    pcr->pool_ticket != V_ticket_pabuf) {
+ #else
+ 		    pcr->pool_ticket != ticket_pabuf) {
+@@ -1985,7 +1985,7 @@
+ 		}
+ 
+ 		if (pcr->action != PF_CHANGE_REMOVE) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			newrule = pool_get(&V_pf_rule_pl, PR_NOWAIT);
+ #else
+ 			newrule = pool_get(&pf_rule_pl, PR_WAITOK|PR_LIMITFAIL);
+@@ -1995,7 +1995,7 @@
+ 				break;
+ 			}
+ 			bcopy(&pcr->rule, newrule, sizeof(struct pf_rule));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			newrule->cuid = td->td_ucred->cr_ruid;
+ 			newrule->cpid = td->td_proc ? td->td_proc->p_pid : 0;
+ #else
+@@ -2008,7 +2008,7 @@
+ 			newrule->entries.tqe_prev = NULL;
+ #ifndef INET
+ 			if (newrule->af == AF_INET) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_rule_pl, newrule);
+ #else
+ 				pool_put(&pf_rule_pl, newrule);
+@@ -2019,7 +2019,7 @@
+ #endif /* INET */
+ #ifndef INET6
+ 			if (newrule->af == AF_INET6) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_rule_pl, newrule);
+ #else
+ 				pool_put(&pf_rule_pl, newrule);
+@@ -2031,7 +2031,7 @@
+ 			if (newrule->ifname[0]) {
+ 				newrule->kif = pfi_kif_get(newrule->ifname);
+ 				if (newrule->kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					pool_put(&V_pf_rule_pl, newrule);
+ #else
+ 					pool_put(&pf_rule_pl, newrule);
+@@ -2044,7 +2044,7 @@
+ 				newrule->kif = NULL;
+ 
+ 			if (newrule->rtableid > 0 &&
+-#ifdef __FreeBSD__ /* ROUTING */
++#ifdef __FreeBSD_kernel__ /* ROUTING */
+ 			    newrule->rtableid > rt_numfibs)
+ #else
+ 			    !rtable_exists(newrule->rtableid))
+@@ -2090,7 +2090,7 @@
+ 				error = EINVAL;
+ 			if (pf_anchor_setup(newrule, ruleset, pcr->anchor_call))
+ 				error = EINVAL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			TAILQ_FOREACH(pa, &V_pf_pabuf, entries)
+ #else
+ 			TAILQ_FOREACH(pa, &pf_pabuf, entries)
+@@ -2108,7 +2108,7 @@
+ 					    PFR_TFLAG_ACTIVE;
+ 			}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pf_mv_pool(&V_pf_pabuf, &newrule->rpool.list);
+ #else
+ 			pf_mv_pool(&pf_pabuf, &newrule->rpool.list);
+@@ -2126,7 +2126,7 @@
+ 				break;
+ 			}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (!V_debug_pfugidhack && (newrule->uid.op ||
+ 			    newrule->gid.op ||
+ 			    newrule->log & PF_LOG_SOCKET_LOOKUP)) {
+@@ -2141,7 +2141,7 @@
+ 			newrule->packets[0] = newrule->packets[1] = 0;
+ 			newrule->bytes[0] = newrule->bytes[1] = 0;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_empty_pool(&V_pf_pabuf);
+ #else
+ 		pf_empty_pool(&pf_pabuf);
+@@ -2202,7 +2202,7 @@
+ 		struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr;
+ 		u_int			 killed = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		for (s = RB_MIN(pf_state_tree_id, &V_tree_id); s; s = nexts) {
+ 			nexts = RB_NEXT(pf_state_tree_id, &V_tree_id, s);
+ #else
+@@ -2222,7 +2222,7 @@
+ 		}
+ 		psk->psk_killed = killed;
+ #if NPFSYNC > 0
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pfsync_clear_states_ptr != NULL)
+ 			pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname);
+ #else
+@@ -2242,7 +2242,7 @@
+ 
+ 		if (psk->psk_pfcmp.id) {
+ 			if (psk->psk_pfcmp.creatorid == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				psk->psk_pfcmp.creatorid = V_pf_status.hostid;
+ #else
+ 				psk->psk_pfcmp.creatorid = pf_status.hostid;
+@@ -2254,7 +2254,7 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		for (s = RB_MIN(pf_state_tree_id, &V_tree_id); s;
+ 		    s = nexts) {
+ 			nexts = RB_NEXT(pf_state_tree_id, &V_tree_id, s);
+@@ -2316,7 +2316,7 @@
+ 			error = EINVAL;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pfsync_state_import_ptr != NULL)
+ 			error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL);
+ #else
+@@ -2350,7 +2350,7 @@
+ 		u_int32_t		 nr = 0;
+ 
+ 		if (ps->ps_len == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			nr = V_pf_status.states;
+ #else
+ 			nr = pf_status.states;
+@@ -2359,17 +2359,17 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		pstore = malloc(sizeof(*pstore), M_TEMP, M_WAITOK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 
+ 		p = ps->ps_states;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		state = TAILQ_FIRST(&V_state_list);
+ #else
+ 		state = TAILQ_FIRST(&state_list);
+@@ -2379,7 +2379,7 @@
+ 				if ((nr+1) * sizeof(*p) > (unsigned)ps->ps_len)
+ 					break;
+ 				pfsync_state_export(pstore, state);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				PF_COPYOUT(pstore, p, sizeof(*p), error);
+ #else
+ 				error = copyout(pstore, p, sizeof(*p));
+@@ -2402,7 +2402,7 @@
+ 
+ 	case DIOCGETSTATUS: {
+ 		struct pf_status *s = (struct pf_status *)addr;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		bcopy(&V_pf_status, s, sizeof(struct pf_status));
+ #else
+ 		bcopy(&pf_status, s, sizeof(struct pf_status));
+@@ -2415,14 +2415,14 @@
+ 		struct pfioc_if	*pi = (struct pfioc_if *)addr;
+ 
+ 		if (pi->ifname[0] == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			bzero(V_pf_status.ifname, IFNAMSIZ);
+ #else
+ 			bzero(pf_status.ifname, IFNAMSIZ);
+ #endif
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		strlcpy(V_pf_status.ifname, pi->ifname, IFNAMSIZ);
+ #else
+ 		strlcpy(pf_status.ifname, pi->ifname, IFNAMSIZ);
+@@ -2431,7 +2431,7 @@
+ 	}
+ 
+ 	case DIOCCLRSTATUS: {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		bzero(V_pf_status.counters, sizeof(V_pf_status.counters));
+ 		bzero(V_pf_status.fcounters, sizeof(V_pf_status.fcounters));
+ 		bzero(V_pf_status.scounters, sizeof(V_pf_status.scounters));
+@@ -2501,14 +2501,14 @@
+ 			error = EINVAL;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		old = V_pf_default_rule.timeout[pt->timeout];
+ #else
+ 		old = pf_default_rule.timeout[pt->timeout];
+ #endif
+ 		if (pt->timeout == PFTM_INTERVAL && pt->seconds == 0)
+ 			pt->seconds = 1;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_default_rule.timeout[pt->timeout] = pt->seconds;
+ #else
+ 		pf_default_rule.timeout[pt->timeout] = pt->seconds;
+@@ -2526,7 +2526,7 @@
+ 			error = EINVAL;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pt->seconds = V_pf_default_rule.timeout[pt->timeout];
+ #else
+ 		pt->seconds = pf_default_rule.timeout[pt->timeout];
+@@ -2541,7 +2541,7 @@
+ 			error = EINVAL;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pl->limit = V_pf_pool_limits[pl->index].limit;
+ #else
+ 		pl->limit = pf_pool_limits[pl->index].limit;
+@@ -2554,7 +2554,7 @@
+ 		int			 old_limit;
+ 
+ 		if (pl->index < 0 || pl->index >= PF_LIMIT_MAX ||
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    V_pf_pool_limits[pl->index].pp == NULL) {
+ #else
+ 		    pf_pool_limits[pl->index].pp == NULL) {
+@@ -2562,7 +2562,7 @@
+ 			error = EINVAL;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		uma_zone_set_max(V_pf_pool_limits[pl->index].pp, pl->limit);
+ 		old_limit = V_pf_pool_limits[pl->index].limit;
+ 		V_pf_pool_limits[pl->index].limit = pl->limit;
+@@ -2583,7 +2583,7 @@
+ 	case DIOCSETDEBUG: {
+ 		u_int32_t	*level = (u_int32_t *)addr;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.debug = *level;
+ #else
+ 		pf_status.debug = *level;
+@@ -2605,7 +2605,7 @@
+ 		break;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	case DIOCGIFSPEED: {
+ 		struct pf_ifspeed	*psp = (struct pf_ifspeed *)addr;
+ 		struct pf_ifspeed	ps;
+@@ -2630,7 +2630,7 @@
+ 		struct pf_altq		*altq;
+ 
+ 		/* enable all altq interfaces on active list */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_FOREACH(altq, V_pf_altqs_active, entries) {
+ 			if (altq->qname[0] == 0 && (altq->local_flags &
+ 			    PFALTQ_FLAG_IF_REMOVED) == 0) {
+@@ -2644,7 +2644,7 @@
+ 			}
+ 		}
+ 		if (error == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_altq_running = 1;
+ #else
+ 			pf_altq_running = 1;
+@@ -2657,7 +2657,7 @@
+ 		struct pf_altq		*altq;
+ 
+ 		/* disable all altq interfaces on active list */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_FOREACH(altq, V_pf_altqs_active, entries) {
+ 			if (altq->qname[0] == 0 && (altq->local_flags &
+ 			    PFALTQ_FLAG_IF_REMOVED) == 0) {
+@@ -2671,7 +2671,7 @@
+ 			}
+ 		}
+ 		if (error == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_altq_running = 0;
+ #else
+ 			pf_altq_running = 0;
+@@ -2684,7 +2684,7 @@
+ 		struct pfioc_altq	*pa = (struct pfioc_altq *)addr;
+ 		struct pf_altq		*altq, *a;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pa->ticket != V_ticket_altqs_inactive) {
+ #else
+ 		if (pa->ticket != ticket_altqs_inactive) {
+@@ -2692,7 +2692,7 @@
+ 			error = EBUSY;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		altq = pool_get(&V_pf_altq_pl, PR_NOWAIT);
+ #else
+ 		altq = pool_get(&pf_altq_pl, PR_WAITOK|PR_LIMITFAIL);
+@@ -2702,7 +2702,7 @@
+ 			break;
+ 		}
+ 		bcopy(&pa->altq, altq, sizeof(struct pf_altq));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		altq->local_flags = 0;
+ #endif
+ 
+@@ -2713,7 +2713,7 @@
+ 		if (altq->qname[0] != 0) {
+ 			if ((altq->qid = pf_qname2qid(altq->qname)) == 0) {
+ 				error = EBUSY;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_altq_pl, altq);
+ #else
+ 				pool_put(&pf_altq_pl, altq);
+@@ -2721,7 +2721,7 @@
+ 				break;
+ 			}
+ 			altq->altq_disc = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			TAILQ_FOREACH(a, V_pf_altqs_inactive, entries) {
+ #else
+ 			TAILQ_FOREACH(a, pf_altqs_inactive, entries) {
+@@ -2734,7 +2734,7 @@
+ 			}
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		struct ifnet *ifp;
+ 
+ 		if ((ifp = ifunit(altq->ifname)) == NULL) {
+@@ -2743,12 +2743,12 @@
+ 			PF_UNLOCK();
+ #endif
+ 		error = altq_add(altq);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_LOCK();
+ 		}
+ #endif
+ 		if (error) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_altq_pl, altq);
+ #else
+ 			pool_put(&pf_altq_pl, altq);
+@@ -2756,7 +2756,7 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_INSERT_TAIL(V_pf_altqs_inactive, altq, entries);
+ #else
+ 		TAILQ_INSERT_TAIL(pf_altqs_inactive, altq, entries);
+@@ -2770,7 +2770,7 @@
+ 		struct pf_altq		*altq;
+ 
+ 		pa->nr = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_FOREACH(altq, V_pf_altqs_active, entries)
+ 			pa->nr++;
+ 		pa->ticket = V_ticket_altqs_active;
+@@ -2787,7 +2787,7 @@
+ 		struct pf_altq		*altq;
+ 		u_int32_t		 nr;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pa->ticket != V_ticket_altqs_active) {
+ #else
+ 		if (pa->ticket != ticket_altqs_active) {
+@@ -2796,7 +2796,7 @@
+ 			break;
+ 		}
+ 		nr = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		altq = TAILQ_FIRST(V_pf_altqs_active);
+ #else
+ 		altq = TAILQ_FIRST(pf_altqs_active);
+@@ -2824,7 +2824,7 @@
+ 		u_int32_t		 nr;
+ 		int			 nbytes;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pq->ticket != V_ticket_altqs_active) {
+ #else
+ 		if (pq->ticket != ticket_altqs_active) {
+@@ -2834,7 +2834,7 @@
+ 		}
+ 		nbytes = pq->nbytes;
+ 		nr = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		altq = TAILQ_FIRST(V_pf_altqs_active);
+ #else
+ 		altq = TAILQ_FIRST(pf_altqs_active);
+@@ -2848,7 +2848,7 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((altq->local_flags & PFALTQ_FLAG_IF_REMOVED) != 0) {
+ 			error = ENXIO;
+ 			break;
+@@ -2856,7 +2856,7 @@
+ 		PF_UNLOCK();
+ #endif
+ 		error = altq_getqstats(altq, pq->buf, &nbytes);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		if (error == 0) {
+@@ -2870,7 +2870,7 @@
+ 	case DIOCBEGINADDRS: {
+ 		struct pfioc_pooladdr	*pp = (struct pfioc_pooladdr *)addr;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_empty_pool(&V_pf_pabuf);
+ 		pp->ticket = ++V_ticket_pabuf;
+ #else
+@@ -2883,7 +2883,7 @@
+ 	case DIOCADDADDR: {
+ 		struct pfioc_pooladdr	*pp = (struct pfioc_pooladdr *)addr;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (pp->ticket != V_ticket_pabuf) {
+ #else
+ 		if (pp->ticket != ticket_pabuf) {
+@@ -2909,7 +2909,7 @@
+ 			error = EINVAL;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pa = pool_get(&V_pf_pooladdr_pl, PR_NOWAIT);
+ #else
+ 		pa = pool_get(&pf_pooladdr_pl, PR_WAITOK|PR_LIMITFAIL);
+@@ -2922,7 +2922,7 @@
+ 		if (pa->ifname[0]) {
+ 			pa->kif = pfi_kif_get(pa->ifname);
+ 			if (pa->kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_pooladdr_pl, pa);
+ #else
+ 				pool_put(&pf_pooladdr_pl, pa);
+@@ -2935,7 +2935,7 @@
+ 		if (pfi_dynaddr_setup(&pa->addr, pp->af)) {
+ 			pfi_dynaddr_remove(&pa->addr);
+ 			pfi_kif_unref(pa->kif, PFI_KIF_REF_RULE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_pooladdr_pl, pa);
+ #else
+ 			pool_put(&pf_pooladdr_pl, pa);
+@@ -2943,7 +2943,7 @@
+ 			error = EINVAL;
+ 			break;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		TAILQ_INSERT_TAIL(&V_pf_pabuf, pa, entries);
+ #else
+ 		TAILQ_INSERT_TAIL(&pf_pabuf, pa, entries);
+@@ -3019,7 +3019,7 @@
+ 			break;
+ 		}
+ 		if (pca->action != PF_CHANGE_REMOVE) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			newpa = pool_get(&V_pf_pooladdr_pl,
+ 			    PR_NOWAIT);
+ #else
+@@ -3033,7 +3033,7 @@
+ 			bcopy(&pca->addr, newpa, sizeof(struct pf_pooladdr));
+ #ifndef INET
+ 			if (pca->af == AF_INET) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_pooladdr_pl, newpa);
+ #else
+ 				pool_put(&pf_pooladdr_pl, newpa);
+@@ -3044,7 +3044,7 @@
+ #endif /* INET */
+ #ifndef INET6
+ 			if (pca->af == AF_INET6) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_pooladdr_pl, newpa);
+ #else
+ 				pool_put(&pf_pooladdr_pl, newpa);
+@@ -3056,7 +3056,7 @@
+ 			if (newpa->ifname[0]) {
+ 				newpa->kif = pfi_kif_get(newpa->ifname);
+ 				if (newpa->kif == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					pool_put(&V_pf_pooladdr_pl, newpa);
+ #else
+ 					pool_put(&pf_pooladdr_pl, newpa);
+@@ -3071,7 +3071,7 @@
+ 			    pf_tbladdr_setup(ruleset, &newpa->addr)) {
+ 				pfi_dynaddr_remove(&newpa->addr);
+ 				pfi_kif_unref(newpa->kif, PFI_KIF_REF_RULE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_pooladdr_pl, newpa);
+ #else
+ 				pool_put(&pf_pooladdr_pl, newpa);
+@@ -3104,7 +3104,7 @@
+ 			pfi_dynaddr_remove(&oldpa->addr);
+ 			pf_tbladdr_remove(&oldpa->addr);
+ 			pfi_kif_unref(oldpa->kif, PFI_KIF_REF_RULE);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_pooladdr_pl, oldpa);
+ #else
+ 			pool_put(&pf_pooladdr_pl, oldpa);
+@@ -3139,7 +3139,7 @@
+ 		pr->nr = 0;
+ 		if (ruleset->anchor == NULL) {
+ 			/* XXX kludge for pf_main_ruleset */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			RB_FOREACH(anchor, pf_anchor_global, &V_pf_anchors)
+ #else
+ 			RB_FOREACH(anchor, pf_anchor_global, &pf_anchors)
+@@ -3168,7 +3168,7 @@
+ 		pr->name[0] = 0;
+ 		if (ruleset->anchor == NULL) {
+ 			/* XXX kludge for pf_main_ruleset */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			RB_FOREACH(anchor, pf_anchor_global, &V_pf_anchors)
+ #else
+ 			RB_FOREACH(anchor, pf_anchor_global, &pf_anchors)
+@@ -3414,16 +3414,16 @@
+ 			error = ENODEV;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		ioe = malloc(sizeof(*ioe), M_TEMP, M_WAITOK);
+ 		table = malloc(sizeof(*table), M_TEMP, M_WAITOK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		for (i = 0; i < io->size; i++) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_COPYIN(io->array+i, ioe, sizeof(*ioe), error);
+ 		if (error) {
+ #else
+@@ -3470,7 +3470,7 @@
+ 				}
+ 				break;
+ 			}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYOUT(ioe, io->array+i, sizeof(io->array[i]),
+ 			    error);
+ 			if (error) {
+@@ -3498,16 +3498,16 @@
+ 			error = ENODEV;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		ioe = malloc(sizeof(*ioe), M_TEMP, M_WAITOK);
+ 		table = malloc(sizeof(*table), M_TEMP, M_WAITOK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		for (i = 0; i < io->size; i++) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYIN(io->array+i, ioe, sizeof(*ioe), error);
+ 			if (error) {
+ #else
+@@ -3571,17 +3571,17 @@
+ 			error = ENODEV;
+ 			goto fail;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		ioe = malloc(sizeof(*ioe), M_TEMP, M_WAITOK);
+ 		table = malloc(sizeof(*table), M_TEMP, M_WAITOK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		/* first makes sure everything will succeed */
+ 		for (i = 0; i < io->size; i++) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYIN(io->array+i, ioe, sizeof(*ioe), error);
+ 			if (error) {
+ #else
+@@ -3601,7 +3601,7 @@
+ 					error = EINVAL;
+ 					goto fail;
+ 				}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				if (!V_altqs_inactive_open || ioe->ticket !=
+ 				    V_ticket_altqs_inactive) {
+ #else
+@@ -3648,7 +3648,7 @@
+ 		}
+ 		/* now do the commit - no errors should happen here */
+ 		for (i = 0; i < io->size; i++) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYIN(io->array+i, ioe, sizeof(*ioe), error);
+ 			if (error) {
+ #else
+@@ -3702,7 +3702,7 @@
+ 		int			 space = psn->psn_len;
+ 
+ 		if (space == 0) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			RB_FOREACH(n, pf_src_tree, &V_tree_src_tracking)
+ #else
+ 			RB_FOREACH(n, pf_src_tree, &tree_src_tracking)
+@@ -3712,15 +3712,15 @@
+ 			break;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_UNLOCK();
+ #endif
+ 		pstore = malloc(sizeof(*pstore), M_TEMP, M_WAITOK);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK();
+ #endif
+ 		p = psn->psn_src_nodes;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_FOREACH(n, pf_src_tree, &V_tree_src_tracking) {
+ #else
+ 		RB_FOREACH(n, pf_src_tree, &tree_src_tracking) {
+@@ -3748,7 +3748,7 @@
+ 				    n->conn_rate.count * diff /
+ 				    n->conn_rate.seconds;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			PF_COPYOUT(pstore, p, sizeof(*p), error);
+ #else
+ 			error = copyout(pstore, p, sizeof(*p));
+@@ -3770,7 +3770,7 @@
+ 		struct pf_src_node	*n;
+ 		struct pf_state		*state;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_FOREACH(state, pf_state_tree_id, &V_tree_id) {
+ #else
+ 		RB_FOREACH(state, pf_state_tree_id, &tree_id) {
+@@ -3778,7 +3778,7 @@
+ 			state->src_node = NULL;
+ 			state->nat_src_node = NULL;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_FOREACH(n, pf_src_tree, &V_tree_src_tracking) {
+ #else
+ 		RB_FOREACH(n, pf_src_tree, &tree_src_tracking) {
+@@ -3787,7 +3787,7 @@
+ 			n->states = 0;
+ 		}
+ 		pf_purge_expired_src_nodes(1);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.src_nodes = 0;
+ #else
+ 		pf_status.src_nodes = 0;
+@@ -3802,7 +3802,7 @@
+ 		    (struct pfioc_src_node_kill *)addr;
+ 		u_int			killed = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_FOREACH(sn, pf_src_tree, &V_tree_src_tracking) {
+ #else
+ 		RB_FOREACH(sn, pf_src_tree, &tree_src_tracking) {
+@@ -3818,7 +3818,7 @@
+ 				/* Handle state to src_node linkage */
+ 				if (sn->states != 0) {
+ 					RB_FOREACH(s, pf_state_tree_id,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					    &V_tree_id) {
+ #else
+ 					    &tree_id) {
+@@ -3845,7 +3845,7 @@
+ 	case DIOCSETHOSTID: {
+ 		u_int32_t	*hostid = (u_int32_t *)addr;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (*hostid == 0)
+ 			V_pf_status.hostid = arc4random();
+ 		else
+@@ -3894,7 +3894,7 @@
+ 		break;
+ 	}
+ fail:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_UNLOCK();
+ 
+ 	if (flags & FWRITE)
+@@ -3914,7 +3914,7 @@
+ 	return (error);
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ void
+ pfsync_state_export(struct pfsync_state *sp, struct pf_state *st)
+ {
+@@ -3984,7 +3984,7 @@
+ {
+ 	struct pf_state	*state;
+  
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_FOREACH(state, pf_state_tree_id, &V_tree_id) {
+ #else
+ 	RB_FOREACH(state, pf_state_tree_id, &tree_id) {
+@@ -4025,7 +4025,7 @@
+ 	struct pf_src_node	*n;
+ 	struct pf_state		*state;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_FOREACH(state, pf_state_tree_id, &V_tree_id) {
+ #else
+ 	RB_FOREACH(state, pf_state_tree_id, &tree_id) {
+@@ -4033,7 +4033,7 @@
+ 		state->src_node = NULL;
+ 		state->nat_src_node = NULL;
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	RB_FOREACH(n, pf_src_tree, &V_tree_src_tracking) {
+ #else
+ 	RB_FOREACH(n, pf_src_tree, &tree_src_tracking) {
+--- a/sys/contrib/pf/net/pf_lb.c
++++ b/sys/contrib/pf/net/pf_lb.c
+@@ -35,7 +35,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ 
+@@ -43,7 +43,7 @@
+ __FBSDID("$FreeBSD$");
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_bpf.h"
+ #include "opt_pf.h"
+ 
+@@ -86,14 +86,14 @@
+ #include <sys/socketvar.h>
+ #include <sys/kernel.h>
+ #include <sys/time.h>
+-#ifdef  __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/sysctl.h>
+ #endif
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/pool.h>
+ #endif
+ #include <sys/proc.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/kthread.h>
+ #include <sys/lock.h>
+ #include <sys/sx.h>
+@@ -101,7 +101,7 @@
+ #include <sys/rwlock.h>
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/md5.h>
+ #else
+ #include <crypto/md5.h>
+@@ -129,7 +129,7 @@
+ #include <netinet/icmp_var.h>
+ #include <netinet/if_ether.h>
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <dev/rndvar.h>
+ #endif
+ #include <net/pfvar.h>
+@@ -148,7 +148,7 @@
+ #endif /* INET6 */
+ 
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define DPFPRINTF(n, x)	if (V_pf_status.debug >= (n)) printf x
+ #else
+ #define DPFPRINTF(n, x)	if (pf_status.debug >= (n)) printf x
+@@ -278,7 +278,7 @@
+ 		    !pf_match_port(dst->port_op, dst->port[0],
+ 		    dst->port[1], dport))
+ 			r = r->skip[PF_SKIP_DST_PORT].ptr;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag))
+ #else
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag))
+@@ -303,7 +303,7 @@
+ 			pf_step_out_of_anchor(&asd, &ruleset, rs_num, &r,
+ 			    NULL, NULL);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (pf_tag_packet(m, tag, rtableid, pd->pf_mtag))
+ #else
+ 	if (pf_tag_packet(m, tag, rtableid))
+@@ -369,7 +369,7 @@
+ 				high = tmp;
+ 			}
+ 			/* low < high */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			cut = htonl(arc4random()) % (1 + high - low) + low;
+ #else
+ 			cut = arc4random_uniform(1 + high - low) + low;
+@@ -378,7 +378,7 @@
+ 			for (tmp = cut; tmp <= high; ++(tmp)) {
+ 				key.port[0] = htons(tmp);
+ 				if (pf_find_state_all(&key, PF_IN, NULL) ==
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    NULL) {
+ #else
+ 				    NULL && !in_baddynamic(tmp, proto)) {
+@@ -390,7 +390,7 @@
+ 			for (tmp = cut - 1; tmp >= low; --(tmp)) {
+ 				key.port[0] = htons(tmp);
+ 				if (pf_find_state_all(&key, PF_IN, NULL) ==
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				    NULL) {
+ #else
+ 				    NULL && !in_baddynamic(tmp, proto)) {
+@@ -437,7 +437,7 @@
+ 			k.rule.ptr = r;
+ 		else
+ 			k.rule.ptr = NULL;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_status.scounters[SCNT_SRC_NODE_SEARCH]++;
+ 		*sn = RB_FIND(pf_src_tree, &V_tree_src_tracking, &k);
+ #else
+@@ -446,7 +446,7 @@
+ #endif
+ 		if (*sn != NULL && !PF_AZERO(&(*sn)->raddr, af)) {
+ 			PF_ACPY(naddr, &(*sn)->raddr, af);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -597,7 +597,7 @@
+ 	if (*sn != NULL)
+ 		PF_ACPY(&(*sn)->raddr, naddr, af);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (V_pf_status.debug >= PF_DEBUG_MISC &&
+ #else
+ 	if (pf_status.debug >= PF_DEBUG_MISC &&
+@@ -775,7 +775,7 @@
+ 		 * Pretend there was no match.
+ 		 */
+ 		if (!bcmp(*skp, *nkp, sizeof(struct pf_state_key_cmp))) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_state_key_pl, *nkp);
+ 			pool_put(&V_pf_state_key_pl, *skp);
+ #else
+--- a/sys/contrib/pf/net/pf_norm.c
++++ b/sys/contrib/pf/net/pf_norm.c
+@@ -25,7 +25,7 @@
+  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ #include "opt_pf.h"
+@@ -50,7 +50,7 @@
+ #include <sys/socket.h>
+ #include <sys/kernel.h>
+ #include <sys/time.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/pool.h>
+ 
+ #include <dev/rndvar.h>
+@@ -77,7 +77,7 @@
+ 
+ #include <net/pfvar.h>
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ struct pf_frent {
+ 	LIST_ENTRY(pf_frent) fr_next;
+ 	struct ip *fr_ip;
+@@ -96,7 +96,7 @@
+ #define PFFRAG_DROP	0x0004		/* Drop all fragments */
+ #define BUFFER_FRAGMENTS(fr)	(!((fr)->fr_flags & PFFRAG_NOBUFFER))
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ struct pf_fragment {
+ 	RB_ENTRY(pf_fragment) fr_entry;
+ 	TAILQ_ENTRY(pf_fragment) frag_next;
+@@ -116,7 +116,7 @@
+ };
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ TAILQ_HEAD(pf_fragqueue, pf_fragment);
+ TAILQ_HEAD(pf_cachequeue, pf_fragment);
+ VNET_DEFINE(struct pf_fragqueue,	pf_fragqueue);
+@@ -128,7 +128,7 @@
+ TAILQ_HEAD(pf_cachequeue, pf_fragment)	pf_cachequeue;
+ #endif
+ 
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ static __inline int	 pf_frag_compare(struct pf_fragment *,
+ 			    struct pf_fragment *);
+ #else
+@@ -136,7 +136,7 @@
+ 			    struct pf_fragment *);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ RB_HEAD(pf_frag_tree, pf_fragment);
+ VNET_DEFINE(struct pf_frag_tree,	pf_frag_tree);
+ #define	V_pf_frag_tree			VNET(pf_frag_tree)
+@@ -165,7 +165,7 @@
+ #ifdef INET6
+ void			 pf_scrub_ip6(struct mbuf **, u_int8_t);
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	DPFPRINTF(x) do {				\
+ 	if (V_pf_status.debug >= PF_DEBUG_MISC) {	\
+ 		printf("%s: ", __func__);		\
+@@ -182,7 +182,7 @@
+ #endif
+ 
+ /* Globals */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(uma_zone_t,		pf_frent_pl);
+ VNET_DEFINE(uma_zone_t,		pf_frag_pl);
+ VNET_DEFINE(uma_zone_t,		pf_cache_pl);
+@@ -202,7 +202,7 @@
+ void
+ pf_normalize_init(void)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	/*
+ 	 * XXX
+ 	 * No high water mark support(It's hint not hard limit).
+@@ -229,7 +229,7 @@
+ 	pool_sethardlimit(&pf_cent_pl, PFFRAG_FRCENT_HIWAT, NULL, 0);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	TAILQ_INIT(&V_pf_fragqueue);
+ 	TAILQ_INIT(&V_pf_cachequeue);
+ #else
+@@ -238,7 +238,7 @@
+ #endif
+ }
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static int
+ #else
+ static __inline int
+@@ -266,7 +266,7 @@
+ pf_purge_expired_fragments(void)
+ {
+ 	struct pf_fragment	*frag;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_int32_t		 expire = time_second -
+ 				    V_pf_default_rule.timeout[PFTM_FRAG];
+ #else
+@@ -274,7 +274,7 @@
+ 				    pf_default_rule.timeout[PFTM_FRAG];
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while ((frag = TAILQ_LAST(&V_pf_fragqueue, pf_fragqueue)) != NULL) {
+ 		KASSERT((BUFFER_FRAGMENTS(frag)),
+ 		    ("BUFFER_FRAGMENTS(frag) == 0: %s", __FUNCTION__));
+@@ -289,7 +289,7 @@
+ 		pf_free_fragment(frag);
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while ((frag = TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue)) != NULL) {
+ 		KASSERT((!BUFFER_FRAGMENTS(frag)),
+ 		    ("BUFFER_FRAGMENTS(frag) != 0: %s", __FUNCTION__));
+@@ -302,7 +302,7 @@
+ 
+ 		DPFPRINTF(("expiring %d(%p)\n", frag->fr_id, frag));
+ 		pf_free_fragment(frag);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		KASSERT((TAILQ_EMPTY(&V_pf_cachequeue) ||
+ 		    TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue) != frag),
+ 		    ("!(TAILQ_EMPTY() || TAILQ_LAST() == farg): %s",
+@@ -324,7 +324,7 @@
+ 	struct pf_fragment	*frag;
+ 	int			 goal;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	goal = V_pf_nfrents * 9 / 10;
+ 	DPFPRINTF(("trying to free > %d frents\n",
+ 	    V_pf_nfrents - goal));
+@@ -335,7 +335,7 @@
+ 	    pf_nfrents - goal));
+ 	while (goal < pf_nfrents) {
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		frag = TAILQ_LAST(&V_pf_fragqueue, pf_fragqueue);
+ #else
+ 		frag = TAILQ_LAST(&pf_fragqueue, pf_fragqueue);
+@@ -346,7 +346,7 @@
+ 	}
+ 
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	goal = V_pf_ncache * 9 / 10;
+ 	DPFPRINTF(("trying to free > %d cache entries\n",
+ 	    V_pf_ncache - goal));
+@@ -357,7 +357,7 @@
+ 	    pf_ncache - goal));
+ 	while (goal < pf_ncache) {
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		frag = TAILQ_LAST(&V_pf_cachequeue, pf_cachequeue);
+ #else
+ 		frag = TAILQ_LAST(&pf_cachequeue, pf_cachequeue);
+@@ -383,7 +383,7 @@
+ 			LIST_REMOVE(frent, fr_next);
+ 
+ 			m_freem(frent->fr_m);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pf_frent_pl, frent);
+ 			V_pf_nfrents--;
+ #else
+@@ -396,7 +396,7 @@
+ 		    frcache = LIST_FIRST(&frag->fr_cache)) {
+ 			LIST_REMOVE(frcache, fr_next);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			KASSERT((LIST_EMPTY(&frag->fr_cache) ||
+ 			    LIST_FIRST(&frag->fr_cache)->fr_off >
+ 			    frcache->fr_end),
+@@ -441,7 +441,7 @@
+ 		/* XXX Are we sure we want to update the timeout? */
+ 		frag->fr_timeout = time_second;
+ 		if (BUFFER_FRAGMENTS(frag)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next);
+ 			TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next);
+ #else
+@@ -449,7 +449,7 @@
+ 			TAILQ_INSERT_HEAD(&pf_fragqueue, frag, frag_next);
+ #endif
+ 		} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			TAILQ_REMOVE(&V_pf_cachequeue, frag, frag_next);
+ 			TAILQ_INSERT_HEAD(&V_pf_cachequeue, frag, frag_next);
+ #else
+@@ -468,7 +468,7 @@
+ pf_remove_fragment(struct pf_fragment *frag)
+ {
+ 	if (BUFFER_FRAGMENTS(frag)) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag);
+ 		TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next);
+ 		pool_put(&V_pf_frag_pl, frag);
+@@ -478,7 +478,7 @@
+ 		pool_put(&pf_frag_pl, frag);
+ #endif
+ 	} else {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_frag_tree, &V_pf_cache_tree, frag);
+ 		TAILQ_REMOVE(&V_pf_cachequeue, frag, frag_next);
+ 		pool_put(&V_pf_cache_pl, frag);
+@@ -504,7 +504,7 @@
+ 	u_int16_t	 ip_len = ntohs(ip->ip_len) - ip->ip_hl * 4;
+ 	u_int16_t	 max = ip_len + off;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((*frag == NULL || BUFFER_FRAGMENTS(*frag)),
+ 	    ("! (*frag == NULL || BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__));
+ #else
+@@ -517,14 +517,14 @@
+ 
+ 	/* Create a new reassembly queue for this packet */
+ 	if (*frag == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		*frag = pool_get(&V_pf_frag_pl, PR_NOWAIT);
+ #else
+ 		*frag = pool_get(&pf_frag_pl, PR_NOWAIT);
+ #endif
+ 		if (*frag == NULL) {
+ 			pf_flush_fragments();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			*frag = pool_get(&V_pf_frag_pl, PR_NOWAIT);
+ #else
+ 			*frag = pool_get(&pf_frag_pl, PR_NOWAIT);
+@@ -542,7 +542,7 @@
+ 		(*frag)->fr_timeout = time_second;
+ 		LIST_INIT(&(*frag)->fr_queue);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_INSERT(pf_frag_tree, &V_pf_frag_tree, *frag);
+ 		TAILQ_INSERT_HEAD(&V_pf_fragqueue, *frag, frag_next);
+ #else
+@@ -565,7 +565,7 @@
+ 		frep = frea;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((frep != NULL || frea != NULL),
+ 	    ("!(frep != NULL || frea != NULL): %s", __FUNCTION__));;
+ #else
+@@ -613,7 +613,7 @@
+ 		next = LIST_NEXT(frea, fr_next);
+ 		m_freem(frea->fr_m);
+ 		LIST_REMOVE(frea, fr_next);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_frent_pl, frea);
+ 		V_pf_nfrents--;
+ #else
+@@ -660,7 +660,7 @@
+ 
+ 	/* We have all the data */
+ 	frent = LIST_FIRST(&(*frag)->fr_queue);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((frent != NULL), ("frent == NULL: %s", __FUNCTION__));
+ #else
+ 	KASSERT(frent != NULL);
+@@ -679,7 +679,7 @@
+ 	m2 = m->m_next;
+ 	m->m_next = NULL;
+ 	m_cat(m, m2);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pf_frent_pl, frent);
+ 	V_pf_nfrents--;
+ #else
+@@ -690,21 +690,21 @@
+ 		next = LIST_NEXT(frent, fr_next);
+ 
+ 		m2 = frent->fr_m;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pf_frent_pl, frent);
+ 		V_pf_nfrents--;
+ #else
+ 		pool_put(&pf_frent_pl, frent);
+ 		pf_nfrents--;
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m->m_pkthdr.csum_flags &= m2->m_pkthdr.csum_flags;
+ 		m->m_pkthdr.csum_data += m2->m_pkthdr.csum_data;
+ #endif
+ 		m_cat(m, m2);
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while (m->m_pkthdr.csum_data & 0xffff0000)
+ 		m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) +
+ 		    (m->m_pkthdr.csum_data >> 16);
+@@ -735,7 +735,7 @@
+ 
+  drop_fragment:
+ 	/* Oops - fail safe - drop packet */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pf_frent_pl, frent);
+ 	V_pf_nfrents--;
+ #else
+@@ -757,7 +757,7 @@
+ 	u_int16_t		 max = ip_len + off;
+ 	int			 hosed = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((*frag == NULL || !BUFFER_FRAGMENTS(*frag)),
+ 	    ("!(*frag == NULL || !BUFFER_FRAGMENTS(*frag)): %s", __FUNCTION__));
+ #else
+@@ -766,14 +766,14 @@
+ 
+ 	/* Create a new range queue for this packet */
+ 	if (*frag == NULL) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		*frag = pool_get(&V_pf_cache_pl, PR_NOWAIT);
+ #else
+ 		*frag = pool_get(&pf_cache_pl, PR_NOWAIT);
+ #endif
+ 		if (*frag == NULL) {
+ 			pf_flush_fragments();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			*frag = pool_get(&V_pf_cache_pl, PR_NOWAIT);
+ #else
+ 			*frag = pool_get(&pf_cache_pl, PR_NOWAIT);
+@@ -783,7 +783,7 @@
+ 		}
+ 
+ 		/* Get an entry for the queue */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		cur = pool_get(&V_pf_cent_pl, PR_NOWAIT);
+ 		if (cur == NULL) {
+ 			pool_put(&V_pf_cache_pl, *frag);
+@@ -795,7 +795,7 @@
+ 			*frag = NULL;
+ 			goto no_mem;
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_ncache++;
+ #else
+ 		pf_ncache++;
+@@ -814,7 +814,7 @@
+ 		LIST_INIT(&(*frag)->fr_cache);
+ 		LIST_INSERT_HEAD(&(*frag)->fr_cache, cur, fr_next);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_INSERT(pf_frag_tree, &V_pf_cache_tree, *frag);
+ 		TAILQ_INSERT_HEAD(&V_pf_cachequeue, *frag, frag_next);
+ #else
+@@ -838,7 +838,7 @@
+ 		frp = fra;
+ 	}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((frp != NULL || fra != NULL),
+ 	    ("!(frp != NULL || fra != NULL): %s", __FUNCTION__));
+ #else
+@@ -885,14 +885,14 @@
+ 				 * than this mbuf magic.  For my next trick,
+ 				 * I'll pull a rabbit out of my laptop.
+ 				 */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				*m0 = m_dup(m, M_DONTWAIT);
+ #else
+ 				*m0 = m_copym2(m, 0, h->ip_hl << 2, M_NOWAIT);
+ #endif
+ 				if (*m0 == NULL)
+ 					goto no_mem;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				/* From KAME Project : We have missed this! */
+ 				m_adj(*m0, (h->ip_hl << 2) -
+ 				    (*m0)->m_pkthdr.len);
+@@ -917,7 +917,7 @@
+ 
+ 				h = mtod(m, struct ip *);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				KASSERT(((int)m->m_len ==
+ 				    ntohs(h->ip_len) - precut),
+ 				    ("m->m_len != ntohs(h->ip_len) - precut: %s",
+@@ -939,14 +939,14 @@
+ 			    h->ip_id, -precut, frp->fr_off, frp->fr_end, off,
+ 			    max));
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			cur = pool_get(&V_pf_cent_pl, PR_NOWAIT);
+ #else
+ 			cur = pool_get(&pf_cent_pl, PR_NOWAIT);
+ #endif
+ 			if (cur == NULL)
+ 				goto no_mem;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_ncache++;
+ #else
+ 			pf_ncache++;
+@@ -989,7 +989,7 @@
+ 					m->m_pkthdr.len = plen;
+ 				}
+ 				h = mtod(m, struct ip *);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				KASSERT(((int)m->m_len == ntohs(h->ip_len) - aftercut),
+ 				    ("m->m_len != ntohs(h->ip_len) - aftercut: %s",
+ 				    __FUNCTION__));
+@@ -1007,14 +1007,14 @@
+ 			    h->ip_id, -aftercut, off, max, fra->fr_off,
+ 			    fra->fr_end));
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			cur = pool_get(&V_pf_cent_pl, PR_NOWAIT);
+ #else
+ 			cur = pool_get(&pf_cent_pl, PR_NOWAIT);
+ #endif
+ 			if (cur == NULL)
+ 				goto no_mem;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			V_pf_ncache++;
+ #else
+ 			pf_ncache++;
+@@ -1036,7 +1036,7 @@
+ 				    max, fra->fr_off, fra->fr_end));
+ 				fra->fr_off = cur->fr_off;
+ 				LIST_REMOVE(cur, fr_next);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_cent_pl, cur);
+ 				V_pf_ncache--;
+ #else
+@@ -1047,7 +1047,7 @@
+ 
+ 			} else if (frp && fra->fr_off <= frp->fr_end) {
+ 				/* Need to merge in a modified 'frp' */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				KASSERT((cur == NULL), ("cur != NULL: %s",
+ 				    __FUNCTION__));
+ #else
+@@ -1059,7 +1059,7 @@
+ 				    max, fra->fr_off, fra->fr_end));
+ 				fra->fr_off = frp->fr_off;
+ 				LIST_REMOVE(frp, fr_next);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				pool_put(&V_pf_cent_pl, frp);
+ 				V_pf_ncache--;
+ #else
+@@ -1169,7 +1169,7 @@
+ 		    (struct pf_addr *)&h->ip_dst.s_addr, AF_INET,
+ 		    r->dst.neg, NULL))
+ 			r = r->skip[PF_SKIP_DST_ADDR].ptr;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag))
+ #else
+ 		else if (r->match_tag && !pf_match_tag(m, r, &tag))
+@@ -1233,7 +1233,7 @@
+ 	if ((r->rule_flag & (PFRULE_FRAGCROP|PFRULE_FRAGDROP)) == 0) {
+ 		/* Fully buffer all of the fragments */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		frag = pf_find_fragment(h, &V_pf_frag_tree);
+ #else
+ 		frag = pf_find_fragment(h, &pf_frag_tree);
+@@ -1245,7 +1245,7 @@
+ 			goto bad;
+ 
+ 		/* Get an entry for the fragment queue */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		frent = pool_get(&V_pf_frent_pl, PR_NOWAIT);
+ #else
+ 		frent = pool_get(&pf_frent_pl, PR_NOWAIT);
+@@ -1254,7 +1254,7 @@
+ 			REASON_SET(reason, PFRES_MEMORY);
+ 			return (PF_DROP);
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pf_nfrents++;
+ #else
+ 		pf_nfrents++;
+@@ -1289,7 +1289,7 @@
+ 		/* non-buffering fragment cache (drops or masks overlaps) */
+ 		int	nomem = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (dir == PF_OUT && pd->pf_mtag->flags & PF_TAG_FRAGCACHE) {
+ #else
+ 		if (dir == PF_OUT && m->m_pkthdr.pf.flags & PF_TAG_FRAGCACHE) {
+@@ -1302,7 +1302,7 @@
+ 			goto fragment_pass;
+ 		}
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		frag = pf_find_fragment(h, &V_pf_cache_tree);
+ #else
+ 		frag = pf_find_fragment(h, &pf_cache_tree);
+@@ -1337,7 +1337,7 @@
+ 		}
+ #endif
+ 		if (dir == PF_IN)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pd->pf_mtag->flags |= PF_TAG_FRAGCACHE;
+ #else
+ 			m->m_pkthdr.pf.flags |= PF_TAG_FRAGCACHE;
+@@ -1674,7 +1674,7 @@
+ 
+ 	/* copy back packet headers if we sanitized */
+ 	if (rewrite)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		m_copyback(m, off, sizeof(*th), (caddr_t)th);
+ #else
+ 		m_copyback(m, off, sizeof(*th), th);
+@@ -1697,7 +1697,7 @@
+ 	u_int8_t hdr[60];
+ 	u_int8_t *opt;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((src->scrub == NULL), 
+ 	    ("pf_normalize_tcp_init: src->scrub != NULL"));
+ 
+@@ -1782,7 +1782,7 @@
+ void
+ pf_normalize_tcp_cleanup(struct pf_state *state)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (state->src.scrub)
+ 		pool_put(&V_pf_state_scrub_pl, state->src.scrub);
+ 	if (state->dst.scrub)
+@@ -1810,7 +1810,7 @@
+ 	int copyback = 0;
+ 	int got_ts = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	KASSERT((src->scrub || dst->scrub), 
+ 	    ("pf_normalize_tcp_statefull: src->scrub && dst->scrub!"));
+ #else
+@@ -1870,7 +1870,7 @@
+ 
+ 				if (got_ts) {
+ 					/* Huh?  Multiple timestamps!? */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 					if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 					if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1943,7 +1943,7 @@
+ 	if (src->scrub && (src->scrub->pfss_flags & PFSS_PAWS) &&
+ 	    (uptime.tv_sec - src->scrub->pfss_last.tv_sec > TS_MAX_IDLE ||
+ 	    time_second - state->creation > TS_MAX_CONN))  {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -1957,7 +1957,7 @@
+ 	}
+ 	if (dst->scrub && (dst->scrub->pfss_flags & PFSS_PAWS) &&
+ 	    uptime.tv_sec - dst->scrub->pfss_last.tv_sec > TS_MAX_IDLE) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 		if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -2045,7 +2045,7 @@
+ 		 * this packet.
+ 		 */
+ 		if ((ts_fudge = state->rule.ptr->timeout[PFTM_TS_DIFF]) == 0)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			ts_fudge = V_pf_default_rule.timeout[PFTM_TS_DIFF];
+ #else
+ 			ts_fudge = pf_default_rule.timeout[PFTM_TS_DIFF];
+@@ -2055,7 +2055,7 @@
+ 		/* Calculate max ticks since the last timestamp */
+ #define TS_MAXFREQ	1100		/* RFC max TS freq of 1Khz + 10% skew */
+ #define TS_MICROSECS	1000000		/* microseconds per second */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifndef timersub
+ #define	timersub(tvp, uvp, vvp)						\
+ 	do {								\
+@@ -2092,7 +2092,7 @@
+ 			    tsval_from_last) ? '1' : ' ',
+ 			    SEQ_GT(tsecr, dst->scrub->pfss_tsval) ? '2' : ' ',
+ 			    SEQ_LT(tsecr, dst->scrub->pfss_tsval0)? '3' : ' '));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			DPFPRINTF((" tsval: %u  tsecr: %u  +ticks: %u  "
+ 			    "idle: %jus %lums\n",
+ 			    tsval, tsecr, tsval_from_last,
+@@ -2114,7 +2114,7 @@
+ 			    "\n", dst->scrub->pfss_tsval,
+ 			    dst->scrub->pfss_tsecr, dst->scrub->pfss_tsval0));
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -2166,7 +2166,7 @@
+ 			 * Hey!  Someone tried to sneak a packet in.  Or the
+ 			 * stack changed its RFC1323 behavior?!?!
+ 			 */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC) {
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC) {
+@@ -2197,7 +2197,7 @@
+ 			src->scrub->pfss_flags |= PFSS_DATA_TS;
+ 		else {
+ 			src->scrub->pfss_flags |= PFSS_DATA_NOTS;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			if (V_pf_status.debug >= PF_DEBUG_MISC && dst->scrub &&
+ #else
+ 			if (pf_status.debug >= PF_DEBUG_MISC && dst->scrub &&
+@@ -2255,7 +2255,7 @@
+ 	int		 thoff;
+ 	int		 opt, cnt, optlen = 0;
+ 	int		 rewrite = 0;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	u_char		 opts[TCP_MAXOLEN];
+ #else
+ 	u_char		 opts[MAX_TCPOPTLEN];
+--- a/sys/contrib/pf/net/pf_osfp.c
++++ b/sys/contrib/pf/net/pf_osfp.c
+@@ -17,7 +17,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ #endif
+@@ -26,7 +26,7 @@
+ #include <sys/socket.h>
+ #ifdef _KERNEL
+ #include <sys/systm.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <sys/pool.h>
+ #endif
+ #endif /* _KERNEL */
+@@ -47,7 +47,7 @@
+ 
+ 
+ #ifdef _KERNEL
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	DPFPRINTF(format, x...)		\
+ 	if (V_pf_status.debug >= PF_DEBUG_NOISY)	\
+ 		printf(format , ##x)
+@@ -56,7 +56,7 @@
+ 	if (pf_status.debug >= PF_DEBUG_NOISY)	\
+ 		printf(format , ##x)
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ typedef uma_zone_t pool_t;
+ #else
+ typedef struct pool pool_t;
+@@ -76,7 +76,7 @@
+ #define	pool_put(pool, item)	free(item)
+ #define	pool_init(pool, size, a, ao, f, m, p)	(*(pool)) = (size)
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define	NTOHS(x) (x) = ntohs((u_int16_t)(x))
+ #endif
+ 
+@@ -89,7 +89,7 @@
+ #endif /* _KERNEL */
+ 
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ SLIST_HEAD(pf_osfp_list, pf_os_fingerprint);
+ VNET_DEFINE(struct pf_osfp_list,	pf_osfp_list);
+ #define	V_pf_osfp_list			VNET(pf_osfp_list)
+@@ -284,7 +284,7 @@
+ 	    (fp.fp_flags & PF_OSFP_WSCALE_DC) ? "*" : "",
+ 	    fp.fp_wscale);
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((fpresult = pf_osfp_find(&V_pf_osfp_list, &fp,
+ #else
+ 	if ((fpresult = pf_osfp_find(&pf_osfp_list, &fp,
+@@ -325,14 +325,14 @@
+ }
+ 
+ /* Initialize the OS fingerprint system */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ int
+ #else
+ void
+ #endif
+ pf_osfp_initialize(void)
+ {
+-#if defined(__FreeBSD__) && defined(_KERNEL)
++#if defined(__FreeBSD_kernel__) && defined(_KERNEL)
+ 	int error = ENOMEM;
+ 
+ 	do {
+@@ -351,7 +351,7 @@
+ 	SLIST_INIT(&pf_osfp_list);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #ifdef _KERNEL
+ 	return (error);
+ #else
+@@ -360,7 +360,7 @@
+ #endif
+ }
+ 
+-#if defined(__FreeBSD__) && (_KERNEL)
++#if defined(__FreeBSD_kernel__) && (_KERNEL)
+ void
+ pf_osfp_cleanup(void)
+ {
+@@ -377,7 +377,7 @@
+ 	struct pf_os_fingerprint *fp;
+ 	struct pf_osfp_entry *entry;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	while ((fp = SLIST_FIRST(&V_pf_osfp_list))) {
+ 		SLIST_REMOVE_HEAD(&V_pf_osfp_list, fp_next);
+ #else
+@@ -436,7 +436,7 @@
+ 	    fpioc->fp_os.fp_os);
+ #endif
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if ((fp = pf_osfp_find_exact(&V_pf_osfp_list, &fpadd))) {
+ #else
+ 	if ((fp = pf_osfp_find_exact(&pf_osfp_list, &fpadd))) {
+@@ -446,7 +446,7 @@
+ 				return (EEXIST);
+ 		}
+ 		if ((entry = pool_get(&pf_osfp_entry_pl,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    PR_NOWAIT)) == NULL)
+ #else
+ 		    PR_WAITOK|PR_LIMITFAIL)) == NULL)
+@@ -454,7 +454,7 @@
+ 			return (ENOMEM);
+ 	} else {
+ 		if ((fp = pool_get(&pf_osfp_pl,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    PR_NOWAIT)) == NULL)
+ #else
+ 		    PR_WAITOK|PR_LIMITFAIL)) == NULL)
+@@ -471,7 +471,7 @@
+ 		fp->fp_ttl = fpioc->fp_ttl;
+ 		SLIST_INIT(&fp->fp_oses);
+ 		if ((entry = pool_get(&pf_osfp_entry_pl,
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		    PR_NOWAIT)) == NULL) {
+ #else
+ 		    PR_WAITOK|PR_LIMITFAIL)) == NULL) {
+@@ -479,7 +479,7 @@
+ 			pool_put(&pf_osfp_pl, fp);
+ 			return (ENOMEM);
+ 		}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pf_osfp_insert(&V_pf_osfp_list, fp);
+ #else
+ 		pf_osfp_insert(&pf_osfp_list, fp);
+@@ -625,7 +625,7 @@
+ 
+ 
+ 	memset(fpioc, 0, sizeof(*fpioc));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	SLIST_FOREACH(fp, &V_pf_osfp_list, fp_next) {
+ #else
+ 	SLIST_FOREACH(fp, &pf_osfp_list, fp_next) {
+@@ -656,7 +656,7 @@
+ {
+ 	struct pf_os_fingerprint *f, *f2, find;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	SLIST_FOREACH(f, &V_pf_osfp_list, fp_next) {
+ #else
+ 	SLIST_FOREACH(f, &pf_osfp_list, fp_next) {
+@@ -672,7 +672,7 @@
+ 			find.fp_wsize *= (find.fp_mss + 40);
+ 		else if (f->fp_flags & PF_OSFP_WSIZE_MOD)
+ 			find.fp_wsize *= 2;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (f != (f2 = pf_osfp_find(&V_pf_osfp_list, &find, 0))) {
+ #else
+ 		if (f != (f2 = pf_osfp_find(&pf_osfp_list, &find, 0))) {
+--- a/sys/contrib/pf/net/pf_ruleset.c
++++ b/sys/contrib/pf/net/pf_ruleset.c
+@@ -35,7 +35,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ #endif
+@@ -61,7 +61,7 @@
+ 
+ 
+ #ifdef _KERNEL
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define DPFPRINTF(format, x...)				\
+ 	if (V_pf_status.debug >= PF_DEBUG_NOISY)	\
+ 		printf(format , ##x)
+@@ -70,7 +70,7 @@
+ 	if (pf_status.debug >= PF_DEBUG_NOISY)		\
+ 		printf(format , ##x)
+ #endif
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #define rs_malloc(x)		malloc(x, M_TEMP, M_NOWAIT|M_ZERO)
+ #else
+ #define rs_malloc(x)		malloc(x, M_TEMP, M_WAITOK|M_CANFAIL|M_ZERO)
+@@ -96,7 +96,7 @@
+ #endif /* PFDEBUG */
+ #endif /* _KERNEL */
+ 
+-#if defined(__FreeBSD__) && !defined(_KERNEL)
++#if defined(__FreeBSD_kernel__) && !defined(_KERNEL)
+ #undef V_pf_anchors
+ #define V_pf_anchors		 pf_anchors
+ 
+@@ -104,7 +104,7 @@
+ #define pf_main_ruleset		 pf_main_anchor.ruleset
+ #endif
+ 
+-#if defined(__FreeBSD__) && defined(_KERNEL)
++#if defined(__FreeBSD_kernel__) && defined(_KERNEL)
+ VNET_DEFINE(struct pf_anchor_global,	pf_anchors);
+ VNET_DEFINE(struct pf_anchor,		pf_main_anchor);
+ #else
+@@ -178,7 +178,7 @@
+ 	if (key == NULL)
+ 		return (NULL);
+ 	strlcpy(key->path, path, sizeof(key->path));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	found = RB_FIND(pf_anchor_global, &V_pf_anchors, key);
+ #else
+ 	found = RB_FIND(pf_anchor_global, &pf_anchors, key);
+@@ -208,7 +208,7 @@
+ {
+ 	char			*p, *q, *r;
+ 	struct pf_ruleset	*ruleset;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pf_anchor	*anchor = NULL, *dup, *parent = NULL;
+ #else
+ 	struct pf_anchor	*anchor, *dup, *parent = NULL;
+@@ -263,7 +263,7 @@
+ 			strlcat(anchor->path, "/", sizeof(anchor->path));
+ 		}
+ 		strlcat(anchor->path, anchor->name, sizeof(anchor->path));
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if ((dup = RB_INSERT(pf_anchor_global, &V_pf_anchors, anchor)) !=
+ #else
+ 		if ((dup = RB_INSERT(pf_anchor_global, &pf_anchors, anchor)) !=
+@@ -284,7 +284,7 @@
+ 				    "RB_INSERT2 '%s' '%s' collides with "
+ 				    "'%s' '%s'\n", anchor->path, anchor->name,
+ 				    dup->path, dup->name);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 				RB_REMOVE(pf_anchor_global, &V_pf_anchors,
+ #else
+ 				RB_REMOVE(pf_anchor_global, &pf_anchors,
+@@ -324,7 +324,7 @@
+ 			    !TAILQ_EMPTY(ruleset->rules[i].inactive.ptr) ||
+ 			    ruleset->rules[i].inactive.open)
+ 				return;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		RB_REMOVE(pf_anchor_global, &V_pf_anchors, ruleset->anchor);
+ #else
+ 		RB_REMOVE(pf_anchor_global, &pf_anchors, ruleset->anchor);
+--- a/sys/contrib/pf/net/pf_table.c
++++ b/sys/contrib/pf/net/pf_table.c
+@@ -30,7 +30,7 @@
+  *
+  */
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include "opt_inet.h"
+ #include "opt_inet6.h"
+ 
+@@ -43,7 +43,7 @@
+ #include <sys/socket.h>
+ #include <sys/mbuf.h>
+ #include <sys/kernel.h>
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ #include <sys/malloc.h>
+ #else
+ #include <sys/pool.h>
+@@ -52,7 +52,7 @@
+ #include <net/if.h>
+ #include <net/route.h>
+ #include <netinet/in.h>
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ #include <netinet/ip_ipsp.h>
+ #endif
+ #include <net/pfvar.h>
+@@ -64,7 +64,7 @@
+ 			return (EINVAL);	\
+ 	} while (0)
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ static inline int
+ _copyin(const void *uaddr, void *kaddr, size_t len)
+ {
+@@ -175,7 +175,7 @@
+ 
+ #define	senderr(e)	do { rv = (e); goto _bad; } while (0)
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ VNET_DEFINE(uma_zone_t,			pfr_ktable_pl);
+ VNET_DEFINE(uma_zone_t,			pfr_kentry_pl);
+ VNET_DEFINE(uma_zone_t,			pfr_kcounters_pl);
+@@ -255,7 +255,7 @@
+ void
+ pfr_initialize(void)
+ {
+-#ifndef __FreeBSD__
++#ifndef __FreeBSD_kernel__
+ 	pool_init(&pfr_ktable_pl, sizeof(struct pfr_ktable), 0, 0, 0,
+ 	    "pfrktable", NULL);
+ 	pool_init(&pfr_kentry_pl, sizeof(struct pfr_kentry), 0, 0, 0,
+@@ -661,13 +661,13 @@
+ 	w.pfrw_addr = addr;
+ 	w.pfrw_free = kt->pfrkt_cnt;
+ 	w.pfrw_flags = flags;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	rv = kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #else
+ 	rv = rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #endif
+ 	if (!rv)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rv = kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree,
+ 		    &w);
+ #else
+@@ -714,13 +714,13 @@
+ 	w.pfrw_flags = flags;
+ 	if (flags & PFR_FLAG_ATOMIC)
+ 		s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	rv = kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #else
+ 	rv = rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #endif
+ 	if (!rv)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rv = kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree, 
+ 		    &w);
+ #else
+@@ -841,7 +841,7 @@
+ 	w.pfrw_op = sweep ? PFRW_SWEEP : PFRW_ENQUEUE;
+ 	w.pfrw_workq = workq;
+ 	if (kt->pfrkt_ip4 != NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, 
+ 		    &w))
+ #else
+@@ -849,7 +849,7 @@
+ #endif
+ 			printf("pfr_enqueue_addrs: IPv4 walktree failed.\n");
+ 	if (kt->pfrkt_ip6 != NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree, 
+ 		    &w))
+ #else
+@@ -867,13 +867,13 @@
+ 
+ 	bzero(&w, sizeof(w));
+ 	w.pfrw_op = PFRW_MARK;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, &w))
+ #else
+ 	if (rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w))
+ #endif
+ 		printf("pfr_mark_addrs: IPv4 walktree failed.\n");
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree, &w))
+ #else
+ 	if (rn_walktree(kt->pfrkt_ip6, pfr_walktree, &w))
+@@ -886,7 +886,7 @@
+ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr *ad, int exact)
+ {
+ 	union sockaddr_union	 sa, mask;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct radix_node_head	*head = NULL;
+ #else
+ 	struct radix_node_head	*head;
+@@ -905,7 +905,7 @@
+ 	if (ADDR_NETWORK(ad)) {
+ 		pfr_prepare_network(&mask, ad->pfra_af, ad->pfra_net);
+ 		s = splsoftnet(); /* rn_lookup makes use of globals */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_LOCK_ASSERT();
+ #endif
+ 		ke = (struct pfr_kentry *)rn_lookup(&sa, &mask, head);
+@@ -928,13 +928,13 @@
+ 	struct pfr_kentry	*ke;
+ 
+ 	if (intr)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO);
+ #else
+ 		ke = pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO);
+ #endif
+ 	else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		ke = pool_get(&V_pfr_kentry_pl, PR_WAITOK|PR_ZERO);
+ #else
+ 		ke = pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL);
+@@ -967,7 +967,7 @@
+ pfr_destroy_kentry(struct pfr_kentry *ke)
+ {
+ 	if (ke->pfrke_counters)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		pool_put(&V_pfr_kcounters_pl, ke->pfrke_counters);
+ 	pool_put(&V_pfr_kentry_pl, ke);
+ #else
+@@ -1055,7 +1055,7 @@
+ 		if (negchange)
+ 			p->pfrke_not = !p->pfrke_not;
+ 		if (p->pfrke_counters) {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pool_put(&V_pfr_kcounters_pl, p->pfrke_counters);
+ #else
+ 			pool_put(&pfr_kcounters_pl, p->pfrke_counters);
+@@ -1112,7 +1112,7 @@
+ {
+ 	union sockaddr_union	 mask;
+ 	struct radix_node	*rn;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct radix_node_head	*head = NULL;
+ #else
+ 	struct radix_node_head	*head;
+@@ -1126,18 +1126,18 @@
+ 		head = kt->pfrkt_ip6;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #endif
+ 	if (KENTRY_NETWORK(ke)) {
+ 		pfr_prepare_network(&mask, ke->pfrke_af, ke->pfrke_net);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rn = rn_addroute(&ke->pfrke_sa, &mask, head, ke->pfrke_node);
+ #else
+ 		rn = rn_addroute(&ke->pfrke_sa, &mask, head, ke->pfrke_node, 0);
+ #endif
+ 	} else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rn = rn_addroute(&ke->pfrke_sa, NULL, head, ke->pfrke_node);
+ #else
+ 		rn = rn_addroute(&ke->pfrke_sa, NULL, head, ke->pfrke_node, 0);
+@@ -1152,7 +1152,7 @@
+ {
+ 	union sockaddr_union	 mask;
+ 	struct radix_node	*rn;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct radix_node_head	*head = NULL;
+ #else
+ 	struct radix_node_head	*head;
+@@ -1165,18 +1165,18 @@
+ 		head = kt->pfrkt_ip6;
+ 
+ 	s = splsoftnet();
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	PF_LOCK_ASSERT();
+ #endif
+ 	if (KENTRY_NETWORK(ke)) {
+ 		pfr_prepare_network(&mask, ke->pfrke_af, ke->pfrke_net);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rn = rn_delete(&ke->pfrke_sa, &mask, head);
+ #else
+ 		rn = rn_delete(&ke->pfrke_sa, &mask, head, NULL);
+ #endif
+ 	} else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		rn = rn_delete(&ke->pfrke_sa, NULL, head);
+ #else
+ 		rn = rn_delete(&ke->pfrke_sa, NULL, head, NULL);
+@@ -1271,7 +1271,7 @@
+ 		if (ke->pfrke_af == AF_INET) {
+ 			if (w->pfrw_dyn->pfid_acnt4++ > 0)
+ 				break;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pfr_prepare_network(&V_pfr_mask, AF_INET, ke->pfrke_net);
+ #else
+ 			pfr_prepare_network(&pfr_mask, AF_INET, ke->pfrke_net);
+@@ -1279,7 +1279,7 @@
+ 			w->pfrw_dyn->pfid_addr4 = *SUNION2PF(
+ 			    &ke->pfrke_sa, AF_INET);
+ 			w->pfrw_dyn->pfid_mask4 = *SUNION2PF(
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    &V_pfr_mask, AF_INET);
+ #else
+ 			    &pfr_mask, AF_INET);
+@@ -1287,7 +1287,7 @@
+ 		} else if (ke->pfrke_af == AF_INET6){
+ 			if (w->pfrw_dyn->pfid_acnt6++ > 0)
+ 				break;
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			pfr_prepare_network(&V_pfr_mask, AF_INET6, ke->pfrke_net);
+ #else
+ 			pfr_prepare_network(&pfr_mask, AF_INET6, ke->pfrke_net);
+@@ -1295,7 +1295,7 @@
+ 			w->pfrw_dyn->pfid_addr6 = *SUNION2PF(
+ 			    &ke->pfrke_sa, AF_INET6);
+ 			w->pfrw_dyn->pfid_mask6 = *SUNION2PF(
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			    &V_pfr_mask, AF_INET6);
+ #else
+ 			    &pfr_mask, AF_INET6);
+@@ -2082,13 +2082,13 @@
+ 	struct pf_ruleset	*rs;
+ 
+ 	if (intr)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO);
+ #else
+ 		kt = pool_get(&pfr_ktable_pl, PR_NOWAIT|PR_ZERO|PR_LIMITFAIL);
+ #endif
+ 	else
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt = pool_get(&V_pfr_ktable_pl, PR_WAITOK|PR_ZERO);
+ #else
+ 		kt = pool_get(&pfr_ktable_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL);
+@@ -2140,7 +2140,7 @@
+ 		pfr_clean_node_mask(kt, &addrq);
+ 		pfr_destroy_kentries(&addrq);
+ 	}
+-#if defined(__FreeBSD__) && (__FreeBSD_version >= 500100)
++#if defined(__FreeBSD_kernel__) && (__FreeBSD_version >= 500100)
+ 	if (kt->pfrkt_ip4 != NULL) {
+ 		RADIX_NODE_HEAD_DESTROY(kt->pfrkt_ip4);
+ 		free((caddr_t)kt->pfrkt_ip4, M_RTABLE);
+@@ -2161,7 +2161,7 @@
+ 		kt->pfrkt_rs->tables--;
+ 		pf_remove_if_empty_ruleset(kt->pfrkt_rs);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pool_put(&V_pfr_ktable_pl, kt);
+ #else
+ 	pool_put(&pfr_ktable_pl, kt);
+@@ -2200,7 +2200,7 @@
+ 	switch (af) {
+ #ifdef INET
+ 	case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pfr_sin.sin_addr.s_addr = a->addr32[0];
+ 		ke = (struct pfr_kentry *)rn_match(&V_pfr_sin, kt->pfrkt_ip4);
+ #else
+@@ -2213,7 +2213,7 @@
+ #endif /* INET */
+ #ifdef INET6
+ 	case AF_INET6:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		bcopy(a, &V_pfr_sin6.sin6_addr, sizeof(V_pfr_sin6.sin6_addr));
+ 		ke = (struct pfr_kentry *)rn_match(&V_pfr_sin6, kt->pfrkt_ip6);
+ #else
+@@ -2247,7 +2247,7 @@
+ 	switch (af) {
+ #ifdef INET
+ 	case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		V_pfr_sin.sin_addr.s_addr = a->addr32[0];
+ 		ke = (struct pfr_kentry *)rn_match(&V_pfr_sin, kt->pfrkt_ip4);
+ #else
+@@ -2260,7 +2260,7 @@
+ #endif /* INET */
+ #ifdef INET6
+ 	case AF_INET6:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		bcopy(a, &V_pfr_sin6.sin6_addr, sizeof(V_pfr_sin6.sin6_addr));
+ 		ke = (struct pfr_kentry *)rn_match(&V_pfr_sin6, kt->pfrkt_ip6);
+ #else
+@@ -2284,7 +2284,7 @@
+ 	if (ke != NULL && op_pass != PFR_OP_XPASS &&
+ 	    (kt->pfrkt_flags & PFR_TFLAG_COUNTERS)) {
+ 		if (ke->pfrke_counters == NULL)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 			ke->pfrke_counters = pool_get(&V_pfr_kcounters_pl,
+ #else
+ 			ke->pfrke_counters = pool_get(&pfr_kcounters_pl,
+@@ -2347,7 +2347,7 @@
+ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter,
+     struct pf_addr **raddr, struct pf_addr **rmask, sa_family_t af)
+ {
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	struct pfr_kentry	*ke, *ke2 = NULL;
+ 	struct pf_addr		*addr = NULL;
+ #else
+@@ -2357,7 +2357,7 @@
+ 	union sockaddr_union	 mask;
+ 	int			 idx = -1, use_counter = 0;
+ 
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	if (af == AF_INET)
+ 		addr = (struct pf_addr *)&V_pfr_sin.sin_addr;
+ 	else if (af == AF_INET6)
+@@ -2386,13 +2386,13 @@
+ 		kt->pfrkt_nomatch++;
+ 		return (1);
+ 	}
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	pfr_prepare_network(&V_pfr_mask, af, ke->pfrke_net);
+ #else
+ 	pfr_prepare_network(&pfr_mask, af, ke->pfrke_net);
+ #endif
+ 	*raddr = SUNION2PF(&ke->pfrke_sa, af);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 	*rmask = SUNION2PF(&V_pfr_mask, af);
+ #else
+ 	*rmask = SUNION2PF(&pfr_mask, af);
+@@ -2421,7 +2421,7 @@
+ 	}
+ 	for (;;) {
+ 		/* we don't want to use a nested block */
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		if (af == AF_INET)
+ 			ke2 = (struct pfr_kentry *)rn_match(&V_pfr_sin,
+ 			    kt->pfrkt_ip4);
+@@ -2447,7 +2447,7 @@
+ 
+ 		/* we need to increase the counter past the nested block */
+ 		pfr_prepare_network(&mask, AF_INET, ke2->pfrke_net);
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		PF_POOLMASK(addr, addr, SUNION2PF(&mask, af), &V_pfr_ffaddr, af);
+ #else
+ 		PF_POOLMASK(addr, addr, SUNION2PF(&mask, af), &pfr_ffaddr, af);
+@@ -2475,7 +2475,7 @@
+ 	switch (af) {
+ #ifdef INET
+ 	case AF_INET:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #else
+ 		rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+@@ -2484,7 +2484,7 @@
+ #endif /* INET */
+ #ifdef INET6
+ 	case AF_INET6:
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree, &w);
+ #else
+ 		rn_walktree(kt->pfrkt_ip6, pfr_walktree, &w);
+@@ -2510,13 +2510,13 @@
+ 	dyn->pfid_acnt4 = 0;
+ 	dyn->pfid_acnt6 = 0;
+ 	if (!dyn->pfid_af || dyn->pfid_af == AF_INET)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt->pfrkt_ip4->rnh_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #else
+ 		rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ #endif
+ 	if (!dyn->pfid_af || dyn->pfid_af == AF_INET6)
+-#ifdef __FreeBSD__
++#ifdef __FreeBSD_kernel__
+ 		kt->pfrkt_ip6->rnh_walktree(kt->pfrkt_ip6, pfr_walktree, &w);
+ #else
+ 		rn_walktree(kt->pfrkt_ip6, pfr_walktree, &w);

Added: trunk/freebsd-utils/debian/patches/pf_regex_followup.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/pf_regex_followup.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/pf_regex_followup.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,156 @@
+--- a/contrib/pf/authpf/authpf.c
++++ b/contrib/pf/authpf/authpf.c
+@@ -19,6 +19,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/file.h>
+ #include <sys/ioctl.h>
+@@ -155,7 +156,7 @@
+ 	else
+ 		shell = pw->pw_shell;
+ 
+-#ifndef __FreeBSD_kernel__
++#ifndef __FreeBSD__
+ 	login_close(lc);
+ #endif
+ 
+@@ -163,7 +164,7 @@
+ 	    strcmp(shell, PATH_AUTHPF_SHELL_NOIP)) {
+ 		syslog(LOG_ERR, "wrong shell for user %s, uid %u",
+ 		    pw->pw_name, pw->pw_uid);
+-#ifdef __FreeBSD_kernel__
++#ifdef __FreeBSD__
+ 	login_close(lc);
+ #else
+ 		if (shell != pw->pw_shell)
+@@ -172,7 +173,7 @@
+ 		goto die;
+ 	}
+ 
+-#ifdef __FreeBSD_kernel__
++#ifdef __FreeBSD__
+ 	login_close(lc);
+ #else
+ 	if (shell != pw->pw_shell)
+--- a/contrib/pf/ftp-proxy/ftp-proxy.c
++++ b/contrib/pf/ftp-proxy/ftp-proxy.c
+@@ -19,6 +19,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/queue.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+@@ -585,7 +586,7 @@
+ 
+ 		/* We don't care about truncation. */
+ 		vsnprintf(buf, sizeof buf, message, ap);
+-#ifdef __FreeBSD_kernel__
++#ifdef __FreeBSD__
+ 		strvis(visbuf, buf, VIS_CSTYLE | VIS_NL);
+ #else
+ 		strnvis(visbuf, buf, sizeof visbuf, VIS_CSTYLE | VIS_NL);
+--- a/contrib/pf/libevent/kqueue.c
++++ b/contrib/pf/libevent/kqueue.c
+@@ -30,6 +30,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #ifdef HAVE_SYS_TIME_H
+ #include <sys/time.h>
+--- a/contrib/pf/pfctl/parse.y
++++ b/contrib/pf/pfctl/parse.y
+@@ -30,6 +30,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+--- a/contrib/pf/pfctl/pf_print_state.c
++++ b/contrib/pf/pfctl/pf_print_state.c
+@@ -33,6 +33,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #ifdef __FreeBSD_kernel__
+--- a/contrib/pf/pfctl/pfctl.c
++++ b/contrib/pf/pfctl/pfctl.c
+@@ -34,6 +34,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+--- a/contrib/pf/pfctl/pfctl_altq.c
++++ b/contrib/pf/pfctl/pfctl_altq.c
+@@ -21,6 +21,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+--- a/contrib/pf/pfctl/pfctl_optimize.c
++++ b/contrib/pf/pfctl/pfctl_optimize.c
+@@ -19,6 +19,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+--- a/contrib/pf/pfctl/pfctl_qstats.c
++++ b/contrib/pf/pfctl/pfctl_qstats.c
+@@ -19,6 +19,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+--- a/contrib/pf/pflogd/pflogd.c
++++ b/contrib/pf/pflogd/pflogd.c
+@@ -33,6 +33,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/file.h>
+--- a/contrib/pf/pflogd/privsep.c
++++ b/contrib/pf/pflogd/privsep.c
+@@ -20,6 +20,7 @@
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD$");
+ 
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/socket.h>
+--- a/contrib/pf/tftp-proxy/filter.c
++++ b/contrib/pf/tftp-proxy/filter.c
+@@ -20,6 +20,7 @@
+ #include <syslog.h>
+ 
+ #include <sys/ioctl.h>
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ 

Added: trunk/freebsd-utils/debian/patches/pf_regex_h.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/pf_regex_h.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/pf_regex_h.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,439 @@
+
+Generated with:
+
+find b -type f ! -name \*.c ! -name \*.y| while read i ; do \
+	sed -i $i \
+		-e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/defined(__FreeBSD__) || defined(__FreeBSD_kernel__)/g' \
+		-e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)/g' \
+		-e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#if !defined(__FreeBSD__) \&\& !defined(__FreeBSD_kernel__)/g' \
+	; done
+
+--- a/contrib/pf/pfctl/pfctl.h
++++ b/contrib/pf/pfctl/pfctl.h
+@@ -86,7 +86,7 @@
+ int	 pfctl_show_ifaces(const char *, int);
+ FILE	*pfctl_fopen(const char *, const char *);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ extern int altqsupport;
+ extern int dummynetsupport;
+ #define	HTONL(x)		(x) = htonl((__uint32_t)(x))
+--- a/contrib/pf/pfctl/pfctl_parser.h
++++ b/contrib/pf/pfctl/pfctl_parser.h
+@@ -159,7 +159,7 @@
+ 	}			 data;
+ };
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ /*
+  * XXX
+  * Absolutely this is not correct location to define this.
+--- a/sys/contrib/pf/net/if_pflog.h
++++ b/sys/contrib/pf/net/if_pflog.h
+@@ -30,7 +30,7 @@
+ #define	PFLOGIFS_MAX	16
+ 
+ struct pflog_softc {
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	struct ifnet		*sc_ifp;	/* the interface pointer */
+ #else
+ 	struct ifnet		sc_if;		/* the interface */
+@@ -74,7 +74,7 @@
+ #define	OLD_PFLOG_HDRLEN	sizeof(struct old_pfloghdr)
+ 
+ #ifdef _KERNEL
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ struct pf_rule;
+ struct pf_ruleset;
+ struct pfi_kif;
+--- a/sys/contrib/pf/net/if_pflow.h
++++ b/sys/contrib/pf/net/if_pflow.h
+@@ -66,7 +66,7 @@
+ 	unsigned int		 sc_maxcount;
+ 	u_int64_t		 sc_gcounter;
+ 	struct ip_moptions	 sc_imo;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	struct callout		 sc_tmo;
+ #else
+ 	struct timeout		 sc_tmo;
+--- a/sys/contrib/pf/net/if_pfsync.h
++++ b/sys/contrib/pf/net/if_pfsync.h
+@@ -268,7 +268,7 @@
+ 	int		 pfsyncr_authlevel;
+ };
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define	SIOCSETPFSYNC   _IOW('i', 247, struct ifreq)
+ #define	SIOCGETPFSYNC   _IOWR('i', 248, struct ifreq)
+ #endif
+@@ -288,7 +288,7 @@
+ #define	PFSYNC_S_DEFER	0xfe
+ #define	PFSYNC_S_NONE	0xff
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ void			pfsync_input(struct mbuf *, __unused int);
+ #else
+ void			pfsync_input(struct mbuf *, ...);
+@@ -300,7 +300,7 @@
+ #define	PFSYNC_SI_CKSUM		0x02
+ #define	PFSYNC_SI_ACK		0x04
+ int			pfsync_state_import(struct pfsync_state *, u_int8_t);
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ void			pfsync_state_export(struct pfsync_state *,
+ 			    struct pf_state *);
+ #endif
+--- a/sys/contrib/pf/net/pfvar.h
++++ b/sys/contrib/pf/net/pfvar.h
+@@ -37,7 +37,7 @@
+ #include <sys/types.h>
+ #include <sys/queue.h>
+ #include <sys/tree.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include <sys/lock.h>
+ #include <sys/sx.h>
+ #else
+@@ -46,7 +46,7 @@
+ 
+ #include <net/radix.h>
+ #include <net/route.h>
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include <net/if_clone.h>
+ #include <net/pf_mtag.h>
+ #include <vm/uma.h>
+@@ -54,7 +54,7 @@
+ #include <netinet/ip_ipsp.h>
+ #endif
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include <netinet/in.h>
+ #endif
+ 
+@@ -62,7 +62,7 @@
+ 
+ struct ip;
+ struct ip6_hdr;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ struct inpcb;
+ #endif
+ 
+@@ -173,7 +173,7 @@
+ 		}			 a;
+ 		char			 ifname[IFNAMSIZ];
+ 		char			 tblname[PF_TABLE_NAME_SIZE];
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define	RTLABEL_LEN	32
+ #endif
+ 		char			 rtlabelname[RTLABEL_LEN];
+@@ -211,7 +211,7 @@
+  * Address manipulation macros
+  */
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define	splsoftnet()	splnet()
+ 
+ #define	HTONL(x)	(x) = htonl((__uint32_t)(x))
+@@ -236,7 +236,7 @@
+ 	if (var)					\
+ 		uma_zdestroy(var)
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ extern struct mtx pf_task_mtx;
+ 
+ #define	PF_LOCK_ASSERT()	mtx_assert(&pf_task_mtx, MA_OWNED)
+@@ -833,7 +833,7 @@
+ 	u_int64_t		 id;
+ 	u_int32_t		 creatorid;
+ 	u_int8_t		 direction;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	u_int8_t		 pad[2];
+ 	u_int8_t		 local_flags;
+ #define	PFSTATE_EXPIRING 0x01
+@@ -923,7 +923,7 @@
+ 	sa_family_t	 af;
+ 	u_int8_t	 proto;
+ 	u_int8_t	 direction;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	u_int8_t	 local_flags;
+ #define	PFSTATE_EXPIRING		0x01
+ 	u_int8_t	 pad;
+@@ -935,7 +935,7 @@
+ 	u_int8_t	 updates;
+ } __packed;
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #ifdef _KERNEL
+ /* pfsync */
+ typedef int		pfsync_state_import_t(struct pfsync_state *, u_int8_t);
+@@ -1215,7 +1215,7 @@
+ RB_HEAD(pfi_ifhead, pfi_kif);
+ 
+ /* state tables */
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #ifdef _KERNEL
+ VNET_DECLARE(struct pf_state_tree,	 pf_statetbl);
+ #define	V_pf_statetbl			 VNET(pf_statetbl)
+@@ -1277,7 +1277,7 @@
+ 	struct pf_addr	*dst;		/* dst address */
+ 	u_int16_t *sport;
+ 	u_int16_t *dport;
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	struct pf_mtag	*pf_mtag;
+ #endif
+ 
+@@ -1403,7 +1403,7 @@
+ 			*(a) = (x); \
+ 	} while (0)
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define REASON_SET(a, x) \
+ 	do { \
+ 		if ((a) != NULL) \
+@@ -1488,7 +1488,7 @@
+ 	u_int32_t		 parent_qid;	/* parent queue id */
+ 	u_int32_t		 bandwidth;	/* queue bandwidth */
+ 	u_int8_t		 priority;	/* priority */
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ 	u_int8_t		 local_flags;	/* dynamic interface */
+ #define	PFALTQ_FLAG_IF_REMOVED		0x01
+ #endif
+@@ -1768,7 +1768,7 @@
+ #define	DIOCSETIFFLAG	_IOWR('D', 89, struct pfioc_iface)
+ #define	DIOCCLRIFFLAG	_IOWR('D', 90, struct pfioc_iface)
+ #define	DIOCKILLSRCNODES	_IOWR('D', 91, struct pfioc_src_node_kill)
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ struct pf_ifspeed {
+ 	char			ifname[IFNAMSIZ];
+ 	u_int32_t		baudrate;
+@@ -1779,7 +1779,7 @@
+ #ifdef _KERNEL
+ RB_HEAD(pf_src_tree, pf_src_node);
+ RB_PROTOTYPE(pf_src_tree, pf_src_node, entry, pf_src_compare);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_src_tree,	 tree_src_tracking);
+ #define	V_tree_src_tracking		 VNET(tree_src_tracking)
+ #else
+@@ -1789,7 +1789,7 @@
+ RB_HEAD(pf_state_tree_id, pf_state);
+ RB_PROTOTYPE(pf_state_tree_id, pf_state,
+     entry_id, pf_state_compare_id);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_state_tree_id,	 tree_id);
+ #define	V_tree_id			 VNET(tree_id)
+ VNET_DECLARE(struct pf_state_queue,	 state_list);
+@@ -1800,14 +1800,14 @@
+ #endif
+ 
+ TAILQ_HEAD(pf_poolqueue, pf_pool);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_poolqueue,	 pf_pools[2]);
+ #define	V_pf_pools			 VNET(pf_pools)
+ #else
+ extern struct pf_poolqueue		  pf_pools[2];
+ #endif
+ TAILQ_HEAD(pf_altqqueue, pf_altq);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_altqqueue,	 pf_altqs[2]);
+ #define	V_pf_altqs			 VNET(pf_altqs)
+ VNET_DECLARE(struct pf_palist,		 pf_pabuf);
+@@ -1817,7 +1817,7 @@
+ extern struct pf_palist			  pf_pabuf;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(u_int32_t,			 ticket_altqs_active);
+ #define	V_ticket_altqs_active		 VNET(ticket_altqs_active)
+ VNET_DECLARE(u_int32_t,			 ticket_altqs_inactive);
+@@ -1849,7 +1849,7 @@
+ extern void			 pf_tbladdr_remove(struct pf_addr_wrap *);
+ extern void			 pf_tbladdr_copyout(struct pf_addr_wrap *);
+ extern void			 pf_calc_skip_steps(struct pf_rulequeue *);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #ifdef ALTQ
+ extern	void			 pf_altq_ifnet_event(struct ifnet *, int);
+ #endif
+@@ -1886,7 +1886,7 @@
+ extern struct pool		 pf_state_scrub_pl;
+ #endif
+ extern void			 pf_purge_thread(void *);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ extern int			 pf_purge_expired_src_nodes(int);
+ extern int			 pf_purge_expired_states(u_int32_t , int);
+ #else
+@@ -1911,7 +1911,7 @@
+ extern u_int16_t		 pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t,
+ 				    u_int8_t);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct ifnet *,		 sync_ifp);
+ #define	V_sync_ifp		 	 VNET(sync_ifp);
+ VNET_DECLARE(struct pf_rule,		 pf_default_rule);
+@@ -1924,12 +1924,12 @@
+ 				    u_int8_t);
+ void				 pf_rm_rule(struct pf_rulequeue *,
+ 				    struct pf_rule *);
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ struct pf_divert		*pf_find_divert(struct mbuf *);
+ #endif
+ 
+ #ifdef INET
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int	pf_test(int, struct ifnet *, struct mbuf **, struct ether_header *,
+     struct inpcb *);
+ #else
+@@ -1938,7 +1938,7 @@
+ #endif /* INET */
+ 
+ #ifdef INET6
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int	pf_test6(int, struct ifnet *, struct mbuf **, struct ether_header *,
+     struct inpcb *);
+ #else
+@@ -1949,7 +1949,7 @@
+ void	pf_addr_inc(struct pf_addr *, sa_family_t);
+ #endif /* INET6 */
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ u_int32_t	pf_new_isn(struct pf_state *);
+ #endif
+ void   *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *,
+@@ -1986,7 +1986,7 @@
+ void	pf_purge_expired_fragments(void);
+ int	pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *);
+ int	pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int	pf_socket_lookup(int, struct pf_pdesc *,  struct inpcb *);
+ #else
+ int	pf_socket_lookup(int, struct pf_pdesc *);
+@@ -2031,7 +2031,7 @@
+ int	pfr_ina_define(struct pfr_table *, struct pfr_addr *, int, int *,
+ 	    int *, u_int32_t, int);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pfi_kif *,		 pfi_all);
+ #define	V_pfi_all	 		 VNET(pfi_all)
+ #else
+@@ -2039,7 +2039,7 @@
+ #endif
+ 
+ void		 pfi_initialize(void);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ void		 pfi_cleanup(void);
+ #endif
+ struct pfi_kif	*pfi_kif_get(const char *);
+@@ -2061,7 +2061,7 @@
+ int		 pfi_set_flags(const char *, int);
+ int		 pfi_clear_flags(const char *, int);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int		 pf_match_tag(struct mbuf *, struct pf_rule *, int *,
+ 		    struct pf_mtag *);
+ #else
+@@ -2071,7 +2071,7 @@
+ void		 pf_tag2tagname(u_int16_t, char *);
+ void		 pf_tag_ref(u_int16_t);
+ void		 pf_tag_unref(u_int16_t);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int		 pf_tag_packet(struct mbuf *, int, int, struct pf_mtag *);
+ #else
+ int		 pf_tag_packet(struct mbuf *, int, int);
+@@ -2080,14 +2080,14 @@
+ void		 pf_qid2qname(u_int32_t, char *);
+ void		 pf_qid_unref(u_int32_t);
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_status,		 pf_status);
+ #define	V_pf_status			 VNET(pf_status)
+ #else
+ extern struct pf_status	pf_status;
+ #endif
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(uma_zone_t,		 pf_frent_pl);
+ #define	V_pf_frent_pl			 VNET(pf_frent_pl)
+ VNET_DECLARE(uma_zone_t,		 pf_frag_pl);
+@@ -2103,14 +2103,14 @@
+ 	void		*pp;
+ 	unsigned	 limit;
+ };
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ VNET_DECLARE(struct pf_pool_limit,		 pf_pool_limits[PF_LIMIT_MAX]);
+ #define	V_pf_pool_limits			 VNET(pf_pool_limits)
+ #else
+ extern struct pf_pool_limit	pf_pool_limits[PF_LIMIT_MAX];
+ #endif
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ struct pf_frent {
+ 	LIST_ENTRY(pf_frent) fr_next;
+ 	struct ip *fr_ip;
+@@ -2144,7 +2144,7 @@
+ 
+ #endif /* _KERNEL */
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #ifdef _KERNEL
+ VNET_DECLARE(struct pf_anchor_global,		 pf_anchors);
+ #define	V_pf_anchors				 VNET(pf_anchors)
+@@ -2172,7 +2172,7 @@
+ struct pf_ruleset	*pf_find_or_create_ruleset(const char *);
+ void			 pf_rs_initialize(void);
+ 
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
+ #ifdef _KERNEL
+ int			 pf_anchor_copyout(const struct pf_ruleset *,
+ 			    const struct pf_rule *, struct pfioc_rule *);
+@@ -2193,7 +2193,7 @@
+ 	    const struct tcphdr *);
+ void	pf_osfp_flush(void);
+ int	pf_osfp_get(struct pf_osfp_ioctl *);
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ int	pf_osfp_initialize(void);
+ void	pf_osfp_cleanup(void);
+ #else

Added: trunk/freebsd-utils/debian/patches/savecore_signal.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/savecore_signal.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/savecore_signal.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,10 @@
+--- a/sbin/savecore/savecore.c
++++ b/sbin/savecore/savecore.c
+@@ -77,6 +77,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#include <signal.h>
+ #include <time.h>
+ #include <unistd.h>
+ 

Modified: trunk/freebsd-utils/debian/patches/series
===================================================================
--- trunk/freebsd-utils/debian/patches/series	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/patches/series	2012-01-31 19:21:24 UTC (rev 4047)
@@ -1,17 +1,22 @@
-000_devd_usb.diff
-001_unused.diff
+# Patches that come from upstream
+
+# Patches that are in good shape for merging upstream
+pf_regex_c.diff
+pf_regex_h.diff
+pf_regex_followup.diff
+savecore_signal.diff
+
+# Other patches that might or might not be mergeable
 001_dmesg.diff
 002_ifconfig.diff
 003_kbdcontrol.diff
 004_kldconfig.diff
-005_ktrace.diff
 006_mdconfig.diff
 007_mount.diff
 008_mount_hpfs.diff
 009_mount_msdosfs.diff
 010_mount_ntfs.diff
 011_mount_nullfs.diff
-012_mount_std.diff
 013_pf.diff
 014_route.diff
 015_rpc.umntall.diff
@@ -33,10 +38,10 @@
 032_libbsd_overlay.diff
 035_nfs.diff
 036_nfs_glibc.diff
-037_mount_autofs.diff
 038_jail.diff
 039_geom.diff
-040_kdump_multiarch.diff
 041_delete_key.diff
 043_ppp.diff
 044_mount_exec.diff
+tmp_glibc.diff
+ifconfig_nojail.diff

Added: trunk/freebsd-utils/debian/patches/tmp_glibc.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/tmp_glibc.diff	                        (rev 0)
+++ trunk/freebsd-utils/debian/patches/tmp_glibc.diff	2012-01-31 19:21:24 UTC (rev 4047)
@@ -0,0 +1,157 @@
+
+Temporary patch, may hopefully be removed after glibc update.
+
+--- /dev/null
++++ b/extra/getvfsbyname.c
+@@ -0,0 +1,70 @@
++/*
++ * Copyright (c) 1995
++ *	The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#include <stddef.h>
++#include <sys/mount.h>
++#include <sys/sysctl.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++
++/*
++ * Given a filesystem name, determine if it is resident in the kernel,
++ * and if it is resident, return its xvfsconf structure.
++ */
++int
++getvfsbyname(fsname, vfcp)
++	const char *fsname;
++	struct xvfsconf *vfcp;
++{
++	struct xvfsconf *xvfsp;
++	size_t buflen;
++	int cnt, i;
++
++	if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0)
++		return (-1);
++	xvfsp = malloc(buflen);
++	if (xvfsp == NULL)
++		return (-1);
++	if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) {
++		free(xvfsp);
++		return (-1);
++	}
++	cnt = buflen / sizeof(struct xvfsconf);
++	for (i = 0; i < cnt; i++) {
++		if (strcmp(fsname, xvfsp[i].vfc_name) == 0) {
++			memcpy(vfcp, xvfsp + i, sizeof(struct xvfsconf));
++			free(xvfsp);
++			return (0);
++		}
++	}
++	free(xvfsp);
++	errno = ENOENT;
++	return (-1);
++}
+--- a/sbin/nfsiod/Makefile
++++ b/sbin/nfsiod/Makefile
+@@ -2,6 +2,9 @@
+ # $FreeBSD$
+ 
+ PROG=	nfsiod
++SRCS= nfsiod.c getvfsbyname.c
+ MAN=	nfsiod.8
+ 
++.PATH: ${.CURDIR}/../../extra
++
+ .include <bsd.prog.mk>
+--- a/sbin/umount/Makefile
++++ b/sbin/umount/Makefile
+@@ -3,13 +3,13 @@
+ # $FreeBSD$
+ 
+ PROG=	umount
+-SRCS=	umount.c vfslist.c mounttab.c
++SRCS=	umount.c vfslist.c mounttab.c getvfsbyname.c
+ MAN=	umount.8
+ 
+ MOUNT=	${.CURDIR}/../mount
+ UMNTALL= ${.CURDIR}/../../usr.sbin/rpc.umntall
+ CFLAGS+= -I${MOUNT} -I${UMNTALL}
+ 
+-.PATH: ${MOUNT} ${UMNTALL}
++.PATH: ${MOUNT} ${UMNTALL} ${.CURDIR}/../../extra
+ 
+ .include <bsd.prog.mk>
+--- a/usr.sbin/mountd/Makefile
++++ b/usr.sbin/mountd/Makefile
+@@ -2,14 +2,14 @@
+ # $FreeBSD$
+ 
+ PROG=	mountd
+-SRCS=	mountd.c getmntopts.c
++SRCS=	mountd.c getmntopts.c getvfsbyname.c
+ MAN=	exports.5 netgroup.5 mountd.8
+ 
+ MOUNT=  ${.CURDIR}/../../sbin/mount
+ CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys
+ WARNS?= 2
+ 
+-.PATH: ${MOUNT}
++.PATH: ${MOUNT} ${.CURDIR}/../../extra
+ 
+ DPADD=	${LIBUTIL}
+ LDADD=	-ltirpc -lbsd
+--- a/usr.bin/kdump/kdump.c
++++ b/usr.bin/kdump/kdump.c
+@@ -43,7 +43,7 @@
+ 
+ #define _KERNEL
+ extern int errno;
+-#include <sys/errno.h>
++#include "/usr/include/sys/errno.h"
+ #undef _KERNEL
+ #include <sys/param.h>
+ #include <sys/errno.h>
+@@ -484,7 +484,8 @@
+ 	(void)printf("%s  ", type);
+ }
+ 
+-#include <sys/syscall.h>
++#undef _SYSCALL_H
++#include "/usr/include/sys/syscall.h"
+ #define KTRACE
+ #include <sys/kern/syscalls.c>
+ #undef KTRACE
+--- a/sbin/ifconfig/ifconfig.c
++++ b/sbin/ifconfig/ifconfig.c
+@@ -311,7 +311,7 @@
+ 		}
+ 		cp = ifa->ifa_name;
+ 
+-		if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0)
++		if ((ifa->ifa_flags & 0x10000) != 0)
+ 			continue;
+ 		if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
+ 			continue;

Modified: trunk/freebsd-utils/debian/rules
===================================================================
--- trunk/freebsd-utils/debian/rules	2012-01-31 18:55:25 UTC (rev 4046)
+++ trunk/freebsd-utils/debian/rules	2012-01-31 19:21:24 UTC (rev 4047)
@@ -7,7 +7,7 @@
 
 CFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE -D__va_list=__builtin_va_list \
 	$(shell pkg-config --cflags libbsd-overlay) -isystem /usr/include/tirpc \
-	-D__FreeBSD_version=802000
+	-D__FreeBSD_version=__FreeBSD_kernel_version
 CXXFLAGS = $(CFLAGS)
 
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
@@ -18,18 +18,26 @@
 	CXXFLAGS += -O2
 endif
 
+full_version	:= $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g')
+tar_version	:= $(shell echo $(full_version) | sed -e 's/-.*//g')
+svn_revision	:= $(shell echo $(full_version) | sed -e 's/.*~svn\([0-9]*\)-[0-9]*/\1/g')
+version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
+major           := $(shell echo $(version) | sed -e 's/\..*//g')
+revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
+
+SVN		:= http://svn.freebsd.org/base/release/$(version).0
+#SVN		:= http://svn.freebsd.org/base/releng/$(version)
+#SVN		:= http://svn.freebsd.org/base/stable/$(major)
+#SVN		:= http://svn.freebsd.org/base/head
+
 SOURCE = freebsd-utils
-VERSION = $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-[^-]*$$/\1/p')
-SVN_REL = $(shell echo $(VERSION) | sed -ne 's/+[^+]*$$//p')
-SVN = http://svn.freebsd.org/base/release/$(SVN_REL).0
-#SVN = http://svn.freebsd.org/base/releng/$(SVN_REL)
-ORIGDIR = $(SOURCE)-$(VERSION)
-TARNAME = $(SOURCE)_$(VERSION).orig.tar.gz
+ORIGDIR = $(SOURCE)-$(tar_version)
+TARNAME = $(SOURCE)_$(tar_version).orig.tar.gz
 
 PATH := /usr/lib/freebsd:$(PATH)
 DESTDIR = $(CURDIR)/debian/tmp
 PMAKE = COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS) \
-        -I$(CURDIR)/debian/local/include -I$(CURDIR)/include -lbsd" \
+        -isystem /usr/include/freebsd -I$(CURDIR)/debian/local/include -I$(CURDIR)/include -lbsd" \
         NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO \
         DESTDIR=$(DESTDIR) make
 
@@ -46,10 +54,23 @@
 
 get-orig-source:
 	rm -rf $(ORIGDIR)
-	mkdir -p $(ORIGDIR)/sys/kern $(ORIGDIR)/sys/dev/usb $(ORIGDIR)/etc \
+	mkdir -p \
+		$(ORIGDIR)/sys/kern \
+		$(ORIGDIR)/sys/amd64/linux32 \
+		$(ORIGDIR)/sys/i386/linux \
+		$(ORIGDIR)/sys/dev/usb \
+		$(ORIGDIR)/etc \
 		$(ORIGDIR)/include/rpcsvc \
 		$(ORIGDIR)/sys/kgssapi
-	for i in sbin/dmesg sbin/sysctl usr.bin/kdump usr.bin/ktrace \
+	for i in sbin/dmesg sbin/sysctl \
+		\
+		usr.bin/kdump \
+		usr.bin/ktrace \
+		sys/kern/syscalls.c \
+		sys/kern/makesyscalls.sh \
+		sys/amd64/linux32/syscalls.master \
+		sys/i386/linux/syscalls.master \
+		\
 		 usr.sbin/jail bin/chflags \
 		 sbin/devd etc/devd.conf etc/devd sys/dev/usb/usbdevs \
 		 usr.sbin/acpi/acpiconf \
@@ -59,7 +80,7 @@
 		 sbin/route usr.bin/netstat usr.sbin/rpc.umntall \
 		 usr.sbin/ppp usr.sbin/pppctl usr.sbin/arp usr.bin/mkuzip \
 		 sbin/ipfw contrib/pf sbin/pfctl usr.sbin/authpf sys/contrib/pf/net \
-		 sbin/mount_std sbin/umount sbin/mount_autofs sbin/mount_cd9660 \
+		 sbin/mount_std sbin/umount sbin/mount_cd9660 \
 		 sbin/mount_ext2fs sbin/mount_hpfs sbin/mount_msdosfs \
 		 sbin/mount_ntfs sbin/mount_nullfs sbin/mount_udf sbin/mount_unionfs \
 		 sbin/mount_reiserfs sbin/mount \
@@ -68,7 +89,7 @@
 		 sbin/geom sys/geom/eli sys/crypto/sha2 \
 		 usr.sbin/kbdcontrol usr.sbin/vidcontrol share/syscons \
 		 sbin/savecore sbin/dumpon \
-		 sys/kern/syscalls.c etc/pf.os \
+		etc/pf.os \
 		 usr.sbin/mountd usr.sbin/rpc.statd usr.sbin/rpc.lockd \
 		 usr.sbin/gssd usr.sbin/nfsd usr.sbin/nfscbd \
 		 usr.sbin/nfsdumpstate usr.sbin/nfsuserd usr.sbin/nfsrevoke \
@@ -107,7 +128,6 @@
 	$(PMAKE) -C sbin/geom
 	$(PMAKE) -C sbin/mdconfig
 	$(PMAKE) -C sbin/mount
-	$(PMAKE) -C sbin/mount_autofs
 	$(PMAKE) -C sbin/mount_cd9660
 	$(PMAKE) -C sbin/mount_ext2fs
 	$(PMAKE) -C sbin/mount_hpfs
@@ -164,7 +184,7 @@
 
 freebsd-net-tools: freebsd-net-tools-stamp
 freebsd-net-tools-stamp: lib-stamp
-	$(PMAKE) -C sbin/ifconfig
+	$(PMAKE) -C sbin/ifconfig -DWITHOUT_JAIL
 	$(PMAKE) -C sbin/pfctl
 	$(PMAKE) -C sbin/route
 	$(PMAKE) -C usr.bin/netstat
@@ -222,7 +242,6 @@
 	$(PMAKE) -C sbin/geom clean
 	$(PMAKE) -C sbin/mdconfig clean
 	$(PMAKE) -C sbin/mount clean
-	$(PMAKE) -C sbin/mount_autofs clean
 	$(PMAKE) -C sbin/mount_cd9660 clean
 	$(PMAKE) -C sbin/mount_ext2fs clean
 	$(PMAKE) -C sbin/mount_hpfs clean




More information about the Glibc-bsd-commits mailing list