summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasper <jasper@openbsd.org>2011-03-31 10:36:42 +0000
committerjasper <jasper@openbsd.org>2011-03-31 10:36:42 +0000
commit20c3ef60b71ea19540b862db34745317be2d7dae (patch)
tree2154dcd844ce0a9594fbcc378eb6b392adff7587
parentMake sure everything run from .init and .fini sections gets a properly aligned (diff)
downloadwireguard-openbsd-20c3ef60b71ea19540b862db34745317be2d7dae.tar.xz
wireguard-openbsd-20c3ef60b71ea19540b862db34745317be2d7dae.zip
- use nitems(); no binary change
ok claudio@
-rw-r--r--sys/net/rtsock.c4
-rw-r--r--sys/netinet/in_proto.c6
-rw-r--r--sys/netinet/ip_id.c4
-rw-r--r--sys/netinet/ip_ipsp.c4
-rw-r--r--sys/netinet6/in6_proto.c4
-rw-r--r--sys/netmpls/mpls_proto.c4
-rw-r--r--sys/netnatm/natm_proto.c4
7 files changed, 15 insertions, 15 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 55f111c7a70..45c1203d88c 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.114 2011/02/14 12:53:27 tedu Exp $ */
+/* $OpenBSD: rtsock.c,v 1.115 2011/03/31 10:36:42 jasper Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -1469,4 +1469,4 @@ struct protosw routesw[] = {
struct domain routedomain =
{ PF_ROUTE, "route", route_init, 0, 0,
- routesw, &routesw[sizeof(routesw)/sizeof(routesw[0])] };
+ routesw, &routesw[nitems(routesw)] };
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index ee8fff3e74b..c146e49bceb 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_proto.c,v 1.55 2011/01/07 17:50:42 bluhm Exp $ */
+/* $OpenBSD: in_proto.c,v 1.56 2011/03/31 10:36:42 jasper Exp $ */
/* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */
/*
@@ -315,7 +315,7 @@ struct protosw inetsw[] = {
struct domain inetdomain =
{ AF_INET, "internet", 0, 0, 0,
- inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])], 0,
+ inetsw, &inetsw[nitems(inetsw)], 0,
#ifndef SMALL_KERNEL
rn_mpath_inithead,
#else
@@ -341,6 +341,6 @@ struct protosw hysw[] = {
};
struct domain hydomain =
- { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] };
+ { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[nitems(hysw)] };
#endif
#endif
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c
index 4b1b6c7634d..fa281c73dd6 100644
--- a/sys/netinet/ip_id.c
+++ b/sys/netinet/ip_id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_id.c,v 1.22 2008/06/09 07:07:17 djm Exp $ */
+/* $OpenBSD: ip_id.c,v 1.23 2011/03/31 10:36:42 jasper Exp $ */
/*
* Copyright (c) 2008 Theo de Raadt, Ryan McBride
@@ -59,7 +59,7 @@ ip_randomid(void)
* doing this until the first packet being sent and now must
* generate an ID.
*/
- for (i = 0; i < sizeof(ip_shuffle)/sizeof(ip_shuffle[0]); ++i) {
+ for (i = 0; i < nitems(ip_shuffle); ++i) {
i2 = arc4random_uniform(i + 1);
ip_shuffle[i] = ip_shuffle[i2];
ip_shuffle[i2] = i;
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index 93c18ee3a5d..c8a90947756 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.181 2010/07/09 16:58:06 reyk Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.182 2011/03/31 10:36:42 jasper Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -138,7 +138,7 @@ struct xformsw xformsw[] = {
#endif /* TCP_SIGNATURE */
};
-struct xformsw *xformswNXFORMSW = &xformsw[sizeof(xformsw)/sizeof(xformsw[0])];
+struct xformsw *xformswNXFORMSW = &xformsw[nitems(xformsw)];
unsigned char ipseczeroes[IPSEC_ZEROES_SIZE]; /* zeroes! */
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index 021172b0e1a..75750557e8e 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_proto.c,v 1.61 2011/03/23 13:40:42 claudio Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.62 2011/03/31 10:36:42 jasper Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
@@ -252,7 +252,7 @@ struct ip6protosw inet6sw[] = {
struct domain inet6domain =
{ AF_INET6, "internet6", 0, 0, 0,
(struct protosw *)inet6sw,
- (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0,
+ (struct protosw *)&inet6sw[nitems(inet6sw)], 0,
#ifndef SMALL_KERNEL
rn_mpath_inithead,
#else
diff --git a/sys/netmpls/mpls_proto.c b/sys/netmpls/mpls_proto.c
index 525b19417fe..7d7868a22bc 100644
--- a/sys/netmpls/mpls_proto.c
+++ b/sys/netmpls/mpls_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpls_proto.c,v 1.5 2010/10/15 12:42:56 claudio Exp $ */
+/* $OpenBSD: mpls_proto.c,v 1.6 2011/03/31 10:36:42 jasper Exp $ */
/*
* Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project.
@@ -69,7 +69,7 @@ struct protosw mplssw[] = {
struct domain mplsdomain = {
AF_MPLS, "mpls", mpls_init, 0, 0,
mplssw,
- &mplssw[sizeof(mplssw)/sizeof(mplssw[0])], 0,
+ &mplssw[nitems(mplssw)], 0,
rn_mpath_inithead,
offsetof(struct sockaddr_mpls, smpls_label) << 3,
sizeof(struct sockaddr_mpls)
diff --git a/sys/netnatm/natm_proto.c b/sys/netnatm/natm_proto.c
index fc8363dd3d7..1f55905b61b 100644
--- a/sys/netnatm/natm_proto.c
+++ b/sys/netnatm/natm_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: natm_proto.c,v 1.4 2002/03/14 01:27:12 millert Exp $ */
+/* $OpenBSD: natm_proto.c,v 1.5 2011/03/31 10:36:42 jasper Exp $ */
/*
*
@@ -86,7 +86,7 @@ struct protosw natmsw[] = {
struct domain natmdomain =
{ AF_NATM, "natm", natm_init, 0, 0,
- natmsw, &natmsw[sizeof(natmsw)/sizeof(natmsw[0])], 0,
+ natmsw, &natmsw[nitems(natmsw)], 0,
0, 0, 0};
struct ifqueue natmintrq; /* natm packet input queue */