---
 sys/net/if_dl.h        |   14 +++++++-------
 sys/net/if_var.h       |   20 +++++++++++++++++---
 sys/net/route.h        |    2 ++
 sys/netinet/in_var.h   |    2 ++
 sys/netinet/ip_var.h   |    2 ++
 sys/netinet6/in6_var.h |    3 +++
 sys/sys/fnv_hash.h     |    4 +++-
 7 files changed, 36 insertions(+), 11 deletions(-)

--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -33,6 +33,8 @@
 #ifndef _NET_ROUTE_H_
 #define _NET_ROUTE_H_
 
+#include <sys/socket.h>
+
 /*
  * Kernel resident routing tables.
  *
--- a/sys/net/if_dl.h
+++ b/sys/net/if_dl.h
@@ -59,13 +59,13 @@
  * Structure of a Link-Level sockaddr:
  */
 struct sockaddr_dl {
-	u_char	sdl_len;	/* Total length of sockaddr */
-	u_char	sdl_family;	/* AF_LINK */
-	u_short	sdl_index;	/* if != 0, system given index for interface */
-	u_char	sdl_type;	/* interface type */
-	u_char	sdl_nlen;	/* interface name length, no trailing 0 reqd. */
-	u_char	sdl_alen;	/* link level address length */
-	u_char	sdl_slen;	/* link layer selector length */
+	unsigned char	sdl_len;	/* Total length of sockaddr */
+	unsigned char	sdl_family;	/* AF_LINK */
+	unsigned short	sdl_index;	/* if != 0, system given index for interface */
+	unsigned char	sdl_type;	/* interface type */
+	unsigned char	sdl_nlen;	/* interface name length, no trailing 0 reqd. */
+	unsigned char	sdl_alen;	/* link level address length */
+	unsigned char	sdl_slen;	/* link layer selector length */
 	char	sdl_data[46];	/* minimum work area, can be larger;
 				   contains both if name and ll address */
 };
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -33,6 +33,9 @@
 #ifndef	_NET_IF_VAR_H_
 #define	_NET_IF_VAR_H_
 
+#include <sys/types.h>
+#include <net/if.h>
+
 /*
  * Structures defining a network interface, providing a packet
  * transport mechanism (ala level 0 of the PUP protocols).
@@ -84,7 +87,7 @@ struct	vnet;
 #endif /* _KERNEL */
 #include <sys/lock.h>		/* XXX */
 #include <sys/mutex.h>		/* XXX */
-#include <sys/rwlock.h>		/* XXX */
+#include <sys/_rwlock.h>		/* XXX */
 #include <sys/sx.h>		/* XXX */
 #include <sys/event.h>		/* XXX */
 #include <sys/_task.h>
@@ -710,8 +713,19 @@ drbr_inuse(struct ifnet *ifp, struct buf
  */
 struct ifaddr {
 	struct	sockaddr *ifa_addr;	/* address of interface */
-	struct	sockaddr *ifa_dstaddr;	/* other end of p-to-p link */
-#define	ifa_broadaddr	ifa_dstaddr	/* broadcast address interface */
+	union
+	{
+	struct  sockaddr *ifu_broadaddr; /* broadcast address interface */
+	struct	sockaddr *ifu_dstaddr;	/* other end of p-to-p link */
+	} ifa_ifu;
+/* These very same macros are defined by <ifaddrs.h> for `struct ifaddrs'.
+   So if they are defined already, the existing definitions will be fine.  */
+# ifndef ifa_broadaddr
+#  define ifa_broadaddr ifa_ifu.ifu_broadaddr
+# endif
+# ifndef ifa_dstaddr
+#  define ifa_dstaddr   ifa_ifu.ifu_dstaddr
+# endif
 	struct	sockaddr *ifa_netmask;	/* used to determine subnet */
 	struct	if_data if_data;	/* not all members are meaningful */
 	struct	ifnet *ifa_ifp;		/* back-pointer to interface */
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -34,7 +34,9 @@
 #define _NETINET_IN_VAR_H_
 
 #include <sys/queue.h>
+#include <net/if_var.h>               /* ifaddr */
 #include <sys/fnv_hash.h>
+#include <netinet/in.h>               /* in_addr */
 #include <sys/tree.h>
 
 struct igmp_ifinfo;
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -34,6 +34,8 @@
 #define	_NETINET_IP_VAR_H_
 
 #include <sys/queue.h>
+#include <sys/types.h>		/* u_char, u_short */
+#include <netinet/in.h>		/* in_addr */
 
 /*
  * Overlay for ip header used by other protocols (tcp, udp).
--- a/sys/netinet6/in6_var.h
+++ b/sys/netinet6/in6_var.h
@@ -70,6 +70,9 @@
 #include <sys/libkern.h>
 #endif
 
+#include <sys/types.h>		/* time_t */
+#include <netinet/in_var.h>	/* ifaddr */
+
 /*
  * Interface address, Internet version.  One of these structures
  * is allocated for each interface with an Internet address.
--- a/sys/sys/fnv_hash.h
+++ b/sys/sys/fnv_hash.h
@@ -8,6 +8,8 @@
  * $FreeBSD$
  */
 
+#include <sys/types.h>
+
 typedef u_int32_t Fnv32_t;
 typedef u_int64_t Fnv64_t;
 
@@ -58,7 +60,7 @@ static __inline Fnv64_t
 fnv_64_str(const char *str, Fnv64_t hval)
 {
 	const u_int8_t *s = (const u_int8_t *)str;
-	u_register_t c;		 /* 32 bit on i386, 64 bit on alpha,ia64 */
+	unsigned long int c;	 /* 32 bit on i386, 64 bit on alpha,ia64 */
 
 	while ((c = *s++) != 0) {
 		hval *= FNV_64_PRIME;
