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
This commit is contained in:
Mark Johnston 2020-07-13 19:10:16 +00:00
parent 1f4e879031
commit 165236a101
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363166
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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, ...);