summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2013-05-08 06:30:25 +0000
committerbrad <brad@openbsd.org>2013-05-08 06:30:25 +0000
commit920a7b02b95144b04be5cd9b91165652f3d724ac (patch)
tree00221cbfdb16646cf9f561f20aee87c516a552b8
parentMinor style cleanups. (diff)
downloadwireguard-openbsd-920a7b02b95144b04be5cd9b91165652f3d724ac.tar.xz
wireguard-openbsd-920a7b02b95144b04be5cd9b91165652f3d724ac.zip
Reduce size of some unused arrays.
From Stephane A. Sezer ok bluhm@
-rw-r--r--usr.sbin/rtadvd/rtadvd.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/rtadvd/rtadvd.h b/usr.sbin/rtadvd/rtadvd.h
index 653c899d9e6..49e31949de5 100644
--- a/usr.sbin/rtadvd/rtadvd.h
+++ b/usr.sbin/rtadvd/rtadvd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtadvd.h,v 1.14 2013/04/30 12:29:04 florian Exp $ */
+/* $OpenBSD: rtadvd.h,v 1.15 2013/05/08 06:30:25 brad Exp $ */
/* $KAME: rtadvd.h,v 1.20 2002/05/29 10:13:10 itojun Exp $ */
/*
@@ -82,19 +82,27 @@ struct prefix {
struct in6_addr prefix;
};
+/*
+ * `struct rdnss` may contain an arbitrary number of `servers` and `struct
+ * dnssldom` will contain a variable-sized `domain`. Space required for these
+ * elements will be dynamically allocated. We do not use flexible array members
+ * here because this breaks compile on some architectures using gcc2. Instead,
+ * we just have an array with a single (unused) element.
+ */
+
struct rdnss {
TAILQ_ENTRY(rdnss) entry;
u_int32_t lifetime;
int servercnt;
- struct in6_addr servers[100];
+ struct in6_addr servers[1];
};
struct dnssldom {
TAILQ_ENTRY(dnssldom) entry;
u_int32_t length;
- char domain[100];
+ char domain[1];
};
struct dnssl {