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:
parent
a1ab0ca532
commit
d766bb0d28
@ -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"
|
||||
|
@ -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, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user