From: deraadt Date: Sat, 24 Jan 2015 00:29:06 +0000 (+0000) Subject: Userland (base & ports) was adapted to always include X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=377da2e088c5f8650c7d834461164f98ce9de4b0;p=openbsd Userland (base & ports) was adapted to always include before or . The kernel files can be cleaned up next. Some sockaddr_union steps make it into here as well. ok naddy --- 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 #include #include +#include #include #include #include +#ifdef IPSEC +#include +#endif /* IPSEC */ + #ifdef INET6 #include #include @@ -83,6 +88,7 @@ #define PF_DEBUGNAME "pfsync: " #include +#include #include #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 @@ -39,10 +39,6 @@ #include #endif -#if NPF > 0 -#include -#endif - #include #include #include @@ -52,6 +48,10 @@ #include #include +#if NPF > 0 +#include +#endif + #if NBRIDGE > 0 #include #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 #include #include +#include #include #include #include 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 #include -#if NPFSYNC > 0 -#include -#endif /* NPFSYNC > 0 */ - #if NPFLOG > 0 #include #endif /* NPFLOG > 0 */ +#if NPFSYNC > 0 +#include +#include +#endif /* NPFSYNC > 0 */ + #ifdef INET6 #include #include 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 @@ -40,20 +40,21 @@ #include #include -#include -#include -#include -#include -#include - #include #include #include #include #include +#include #include #include +#include +#include +#include +#include +#include + #ifdef INET6 #include #include 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 #include -#if NPF > 0 -#include -#endif - +#include #include #include #include #include +#if NPF > 0 +#include +#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 #include -#include -#include 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 #include #include -#include #include #include @@ -91,6 +90,8 @@ #include #include +#include + #include #include 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 @@ -25,9 +25,9 @@ #include #include +#include #include #include -#include #include #include @@ -39,6 +39,8 @@ #include #include +#include + 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 #include +#include + +#include +#include +#include +#include #if NPF > 0 #include @@ -57,14 +63,6 @@ #include #endif -#include -#include -#include -#include - -#ifdef INET6 -#endif /* INET6 */ - #include #include #include 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 #include -#if NPF > 0 -#include -#endif - #include #include #include @@ -63,6 +59,10 @@ #include #include +#if NPF > 0 +#include +#endif + #ifdef INET6 #include #include 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 #include - -#if NPF > 0 -#include -#endif +#include #include #include #include #include -#ifdef INET6 -#endif /* INET6 */ +#if NPF > 0 +#include +#endif #include #include 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 #include #include -#include #include #include @@ -88,6 +87,8 @@ #include #include +#include + #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 #include #include +#include #include #include #include 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 #include +#include +#include + #if NPF > 0 #include #endif -#include -#include - #include #include 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 @@ -25,9 +25,9 @@ #include #include +#include #include #include -#include #include #include @@ -40,6 +40,8 @@ #include #include +#include + 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 #include #include -#if NPF > 0 -#include -#endif #include #include @@ -95,6 +92,10 @@ #include #include +#if NPF > 0 +#include +#endif + #include /*