diff options
author | 2015-01-24 00:29:06 +0000 | |
---|---|---|
committer | 2015-01-24 00:29:06 +0000 | |
commit | 377da2e088c5f8650c7d834461164f98ce9de4b0 (patch) | |
tree | 049f7bc23cb432e50e688e3beacb90c45e847d0f | |
parent | In shell statements use shell pattern '+([0-9])', not sed regular (diff) | |
download | wireguard-openbsd-377da2e088c5f8650c7d834461164f98ce9de4b0.tar.xz wireguard-openbsd-377da2e088c5f8650c7d834461164f98ce9de4b0.zip |
Userland (base & ports) was adapted to always include <netinet/in.h>
before <net/pfvar.h> or <net/if_pflog.h>. The kernel files can be
cleaned up next. Some sockaddr_union steps make it into here as well.
ok naddy
-rw-r--r-- | sys/net/if_bridge.h | 4 | ||||
-rw-r--r-- | sys/net/if_pfsync.c | 11 | ||||
-rw-r--r-- | sys/net/if_pfsync.h | 4 | ||||
-rw-r--r-- | sys/net/if_vxlan.c | 10 | ||||
-rw-r--r-- | sys/net/pf.c | 3 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 11 | ||||
-rw-r--r-- | sys/net/pf_norm.c | 15 | ||||
-rw-r--r-- | sys/net/pfkeyv2_convert.c | 11 | ||||
-rw-r--r-- | sys/net/pfvar.h | 17 | ||||
-rw-r--r-- | sys/netinet/in_pcb.c | 5 | ||||
-rw-r--r-- | sys/netinet/ip_divert.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_ipsp.c | 16 | ||||
-rw-r--r-- | sys/netinet/ipsec_input.c | 10 | ||||
-rw-r--r-- | sys/netinet/ipsec_output.c | 12 | ||||
-rw-r--r-- | sys/netinet/raw_ip.c | 5 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 3 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 8 | ||||
-rw-r--r-- | sys/netinet6/ip6_divert.c | 6 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 9 |
19 files changed, 95 insertions, 71 deletions
diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h index eef94a78fc9..395efe789fc 100644 --- a/sys/net/if_bridge.h +++ b/sys/net/if_bridge.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.h,v 1.40 2014/12/22 03:38:01 tedu Exp $ */ +/* $OpenBSD: if_bridge.h,v 1.41 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -407,7 +407,7 @@ struct bridge_rtnode { u_int8_t brt_flags; /* address flags */ u_int8_t brt_age; /* age counter */ struct ether_addr brt_addr; /* dst addr */ - union sockaddr_union brt_tunnel; /* tunnel endpoint */ + union pfsockaddr_union brt_tunnel; /* tunnel endpoint */ }; #ifndef BRIDGE_RTABLE_SIZE diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 9438606d2e1..0cdf4bf167f 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.215 2014/12/19 17:14:39 tedu Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.216 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -63,11 +63,16 @@ #include <netinet/if_ether.h> #include <netinet/tcp.h> #include <netinet/tcp_seq.h> +#include <netinet/tcp_fsm.h> #include <netinet/in_var.h> #include <netinet/ip.h> #include <netinet/ip_var.h> +#ifdef IPSEC +#include <netinet/ip_ipsp.h> +#endif /* IPSEC */ + #ifdef INET6 #include <netinet6/in6_var.h> #include <netinet/ip6.h> @@ -83,6 +88,7 @@ #define PF_DEBUGNAME "pfsync: " #include <net/pfvar.h> +#include <netinet/ip_ipsp.h> #include <net/if_pfsync.h> #include "bpfilter.h" @@ -1203,7 +1209,8 @@ pfsync_update_net_tdb(struct pfsync_tdb *pt) goto bad; s = splsoftnet(); - tdb = gettdb(ntohs(pt->rdomain), pt->spi, &pt->dst, pt->sproto); + tdb = gettdb(ntohs(pt->rdomain), pt->spi, + (union sockaddr_union *)&pt->dst, pt->sproto); if (tdb) { pt->rpl = betoh64(pt->rpl); pt->cur_bytes = betoh64(pt->cur_bytes); diff --git a/sys/net/if_pfsync.h b/sys/net/if_pfsync.h index b2c97ea68e8..44924e4cde0 100644 --- a/sys/net/if_pfsync.h +++ b/sys/net/if_pfsync.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.h,v 1.47 2013/10/24 11:14:33 deraadt Exp $ */ +/* $OpenBSD: if_pfsync.h,v 1.48 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -213,7 +213,7 @@ struct pfsync_bus { struct pfsync_tdb { u_int32_t spi; - union sockaddr_union dst; + union pfsockaddr_union dst; u_int64_t rpl; u_int64_t cur_bytes; u_int8_t sproto; diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index ed312d67db2..e9c6f8e8826 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.20 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.21 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org> @@ -39,10 +39,6 @@ #include <net/bpf.h> #endif -#if NPF > 0 -#include <net/pfvar.h> -#endif - #include <netinet/in.h> #include <netinet/in_var.h> #include <netinet/if_ether.h> @@ -52,6 +48,10 @@ #include <netinet/udp_var.h> #include <netinet/in_pcb.h> +#if NPF > 0 +#include <net/pfvar.h> +#endif + #if NBRIDGE > 0 #include <net/if_bridge.h> #endif diff --git a/sys/net/pf.c b/sys/net/pf.c index 4217404a935..447354ca924 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.898 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: pf.c,v 1.899 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -71,6 +71,7 @@ #include <netinet/in_pcb.h> #include <netinet/tcp_timer.h> #include <netinet/tcp_var.h> +#include <netinet/tcp_fsm.h> #include <netinet/udp_var.h> #include <netinet/icmp_var.h> #include <netinet/if_ether.h> diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 19691a9c8d5..5ec608c7681 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.280 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.281 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -68,14 +68,15 @@ #include <crypto/md5.h> #include <net/pfvar.h> -#if NPFSYNC > 0 -#include <net/if_pfsync.h> -#endif /* NPFSYNC > 0 */ - #if NPFLOG > 0 #include <net/if_pflog.h> #endif /* NPFLOG > 0 */ +#if NPFSYNC > 0 +#include <netinet/ip_ipsp.h> +#include <net/if_pfsync.h> +#endif /* NPFSYNC > 0 */ + #ifdef INET6 #include <netinet/ip6.h> #include <netinet/in_pcb.h> diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index 0f97a746453..47c95dc8851 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.172 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.173 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -40,20 +40,21 @@ #include <sys/pool.h> #include <sys/syslog.h> -#include <net/if.h> -#include <net/if_var.h> -#include <net/if_types.h> -#include <net/bpf.h> -#include <net/if_pflog.h> - #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/ip_var.h> #include <netinet/tcp.h> #include <netinet/tcp_seq.h> +#include <netinet/tcp_fsm.h> #include <netinet/udp.h> #include <netinet/ip_icmp.h> +#include <net/if.h> +#include <net/if_var.h> +#include <net/if_types.h> +#include <net/bpf.h> +#include <net/if_pflog.h> + #ifdef INET6 #include <netinet/ip6.h> #include <netinet6/ip6_var.h> diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index fd1d341dac5..3f6f912ebaf 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.45 2014/12/28 10:02:37 tedu Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.46 2015/01/24 00:29:06 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -103,15 +103,16 @@ #include <net/route.h> #include <net/if.h> -#if NPF > 0 -#include <net/pfvar.h> -#endif - +#include <netinet/in.h> #include <netinet/ip_ipsp.h> #include <net/pfkeyv2.h> #include <crypto/cryptodev.h> #include <crypto/xform.h> +#if NPF > 0 +#include <net/pfvar.h> +#endif + /* * (Partly) Initialize a TDB based on an SADB_SA payload. Other parts * of the TDB will be initialized by other import routines, and tdb_init(). diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index cc29c79a875..824aaaec6ce 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.407 2015/01/15 23:56:58 deraadt Exp $ */ +/* $OpenBSD: pfvar.h,v 1.408 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -41,8 +41,6 @@ #include <net/radix.h> #include <net/route.h> -#include <netinet/ip_ipsp.h> -#include <netinet/tcp_fsm.h> struct ip; struct ip6_hdr; @@ -1084,10 +1082,21 @@ struct pfr_kcounters { u_int64_t states; }; +/* + * XXX ip_ipsp.h's sockaddr_union should be converted to sockaddr * + * passing with correct sa_len, then a good approach for cleaning this + * will become more clear. + */ +union pfsockaddr_union { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; +}; + SLIST_HEAD(pfr_kentryworkq, pfr_kentry); struct _pfr_kentry { struct radix_node _pfrke_node[2]; - union sockaddr_union _pfrke_sa; + union pfsockaddr_union _pfrke_sa; SLIST_ENTRY(pfr_kentry) _pfrke_workq; struct pfr_kcounters *_pfrke_counters; time_t _pfrke_tzero; diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index c31e90c5c36..3f7c7a70c5b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.165 2014/12/17 09:45:59 mpi Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.166 2015/01/24 00:29:06 deraadt Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -83,7 +83,6 @@ #include <net/if.h> #include <net/if_var.h> #include <net/route.h> -#include <net/pfvar.h> #include <netinet/in.h> #include <netinet/ip.h> @@ -91,6 +90,8 @@ #include <netinet/in_var.h> #include <netinet/ip_var.h> +#include <net/pfvar.h> + #include <sys/mount.h> #include <nfs/nfsproto.h> diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 425c2971d27..a1f85cfe60e 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_divert.c,v 1.31 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: ip_divert.c,v 1.32 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -25,9 +25,9 @@ #include <sys/sysctl.h> #include <net/if.h> +#include <net/route.h> #include <net/if_var.h> #include <net/netisr.h> -#include <net/pfvar.h> #include <netinet/in.h> #include <netinet/in_var.h> @@ -39,6 +39,8 @@ #include <netinet/udp.h> #include <netinet/ip_icmp.h> +#include <net/pfvar.h> + struct inpcbtable divbtable; struct divstat divstat; diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index dccfcdcb14d..377a3117e53 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.202 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.203 2015/01/24 00:29:06 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -48,6 +48,12 @@ #include <sys/timeout.h> #include <net/if.h> +#include <net/route.h> + +#include <netinet/in.h> +#include <netinet/ip.h> +#include <netinet/in_pcb.h> +#include <netinet/ip_var.h> #if NPF > 0 #include <net/pfvar.h> @@ -57,14 +63,6 @@ #include <net/if_pfsync.h> #endif -#include <netinet/in.h> -#include <netinet/ip.h> -#include <netinet/in_pcb.h> -#include <netinet/ip_var.h> - -#ifdef INET6 -#endif /* INET6 */ - #include <netinet/ip_ipsp.h> #include <net/pfkeyv2.h> #include <crypto/xform.h> diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index 8607696d0d5..3d75a997aab 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.125 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.126 2015/01/24 00:29:06 deraadt Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -52,10 +52,6 @@ #include <net/bpf.h> #include <net/route.h> -#if NPF > 0 -#include <net/pfvar.h> -#endif - #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/ip_var.h> @@ -63,6 +59,10 @@ #include <netinet/tcp.h> #include <netinet/udp.h> +#if NPF > 0 +#include <net/pfvar.h> +#endif + #ifdef INET6 #include <netinet6/in6_var.h> #include <netinet/ip6.h> diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c index 6dbb74cdfdf..95717a3627b 100644 --- a/sys/netinet/ipsec_output.c +++ b/sys/netinet/ipsec_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_output.c,v 1.55 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: ipsec_output.c,v 1.56 2015/01/24 00:29:06 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -30,18 +30,16 @@ #include <sys/timeout.h> #include <net/if.h> - -#if NPF > 0 -#include <net/pfvar.h> -#endif +#include <net/route.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/in_pcb.h> #include <netinet/ip_var.h> -#ifdef INET6 -#endif /* INET6 */ +#if NPF > 0 +#include <net/pfvar.h> +#endif #include <netinet/udp.h> #include <netinet/ip_ipsp.h> diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 97e484a5019..a16ee6a3843 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.78 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.79 2015/01/24 00:29:06 deraadt Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -78,7 +78,6 @@ #include <net/if.h> #include <net/if_var.h> #include <net/route.h> -#include <net/pfvar.h> #include <netinet/in.h> #include <netinet/ip.h> @@ -88,6 +87,8 @@ #include <netinet/in_var.h> #include <netinet/ip_icmp.h> +#include <net/pfvar.h> + #include "pf.h" struct inpcbtable rawcbtable; diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 66b98b70260..21553e6a220 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.149 2015/01/10 11:43:37 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.150 2015/01/24 00:29:06 deraadt Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -71,6 +71,7 @@ #include <sys/socket.h> #include <sys/socketvar.h> #include <sys/sockio.h> +#include <sys/mbuf.h> #include <sys/systm.h> #include <sys/time.h> #include <sys/kernel.h> diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 5ae87d9f9e1..13c8a064914 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_gif.c,v 1.35 2014/12/19 17:14:40 tedu Exp $ */ +/* $OpenBSD: in6_gif.c,v 1.36 2015/01/24 00:29:06 deraadt Exp $ */ /* $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $ */ /* @@ -44,13 +44,13 @@ #include <net/if.h> #include <net/if_var.h> +#include <netinet/in.h> +#include <netinet/ip_ipsp.h> + #if NPF > 0 #include <net/pfvar.h> #endif -#include <netinet/in.h> -#include <netinet/ip_ipsp.h> - #include <netinet/ip.h> #include <netinet/ip6.h> diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c index e05821b09fa..b82e6c4e362 100644 --- a/sys/netinet6/ip6_divert.c +++ b/sys/netinet6/ip6_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_divert.c,v 1.31 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: ip6_divert.c,v 1.32 2015/01/24 00:29:06 deraadt Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -25,9 +25,9 @@ #include <sys/sysctl.h> #include <net/if.h> +#include <net/route.h> #include <net/if_var.h> #include <net/netisr.h> -#include <net/pfvar.h> #include <netinet/in.h> #include <netinet/ip.h> @@ -40,6 +40,8 @@ #include <netinet/udp.h> #include <netinet/icmp6.h> +#include <net/pfvar.h> + struct inpcbtable divb6table; struct div6stat div6stat; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index f470bbda682..015975a5d65 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.71 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.72 2015/01/24 00:29:06 deraadt Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -77,9 +77,6 @@ #include <net/if_var.h> #include <net/route.h> #include <net/if_types.h> -#if NPF > 0 -#include <net/pfvar.h> -#endif #include <netinet/in.h> #include <netinet6/in6_var.h> @@ -95,6 +92,10 @@ #include <netinet6/ip6protosw.h> #include <netinet6/raw_ip6.h> +#if NPF > 0 +#include <net/pfvar.h> +#endif + #include <sys/stdarg.h> /* |