aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipfw
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-07-13 19:10:16 +0000
committerMark Johnston <markj@FreeBSD.org>2020-07-13 19:10:16 +0000
commit165236a101f4f89ecb800bf31d148911b37823e7 (patch)
tree5e02ecb4d2382c8c19366da400b49b36a95fc74b /sbin/ipfw
parent1f4e879031e788b11000bb65c1460988ac59f94d (diff)
downloadsrc-165236a101f4f89ecb800bf31d148911b37823e7.tar.gz
src-165236a101f4f89ecb800bf31d148911b37823e7.zip
ipfw(8): Handle unaligned pointers in pr_u64.
struct _ipfw_dyn_rule is defined as packed, and as a result, its uint64_t fields are misaligned on some 32-bit platforms. Since pr_u64() is explicitly supposed to handle this case, avoid using a uint64_t * for the input pointer to make sure that the compiler won't (correctly) warn about the misalignment. Reported by: jenkins MFC with: r363164
Notes
Notes: svn path=/head/; revision=363166
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw2.c2
-rw-r--r--sbin/ipfw/ipfw2.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index a577fd7e4825..99513e71e3ff 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -501,7 +501,7 @@ bprint_uint_arg(struct buf_pr *bp, const char *str, uint32_t arg)
* otherwise, return the required width.
*/
int
-pr_u64(struct buf_pr *b, uint64_t *pd, int width)
+pr_u64(struct buf_pr *b, void *pd, int width)
{
#ifdef TCC
#define U64_FMT "I64"
diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h
index 106d74cb15b4..764e5176e8ef 100644
--- a/sbin/ipfw/ipfw2.h
+++ b/sbin/ipfw/ipfw2.h
@@ -328,7 +328,7 @@ struct buf_pr {
size_t needed; /* length needed */
};
-int pr_u64(struct buf_pr *bp, uint64_t *pd, int width);
+int pr_u64(struct buf_pr *bp, void *pd, int width);
int bp_alloc(struct buf_pr *b, size_t size);
void bp_free(struct buf_pr *b);
int bprintf(struct buf_pr *b, const char *format, ...);