summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-02-21 23:00:16 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-02-21 23:00:16 +0000
commitca729831613ef40f914b4dfb8ef93362daa2ff32 (patch)
treecbf038606ef813426eca5af1ddc9c8f2648456d1 /sys
parentfd1cdf24ad1ecd2cc611acec9ada031c4f8b16c1 (diff)
In WI_SETSTR round up i_len to be an even number if needed since we
are going to divide it by 2. More or less based on NetBSD.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/if_wireg.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/if_wireg.h b/sys/dev/ic/if_wireg.h
index 557b2e49c7b..ba4acd21972 100644
--- a/sys/dev/ic/if_wireg.h
+++ b/sys/dev/ic/if_wireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wireg.h,v 1.10 2002/02/19 01:24:58 mickey Exp $ */
+/* $OpenBSD: if_wireg.h,v 1.11 2002/02/21 23:00:15 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -325,9 +325,11 @@ struct wi_ltv_str {
#define WI_SETSTR(recno, str) \
do { \
struct wi_ltv_str s; \
+ int l; \
\
+ l = (str.i_len + 1) & ~0x1; \
bzero((char *)&s, sizeof(s)); \
- s.wi_len = (str.i_len / 2) + 2; \
+ s.wi_len = (l / 2) + 2; \
s.wi_type = recno; \
s.wi_str[0] = htole16(str.i_len); \
bcopy(str.i_nwid, &s.wi_str[1], str.i_len); \