You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logpkt.c: In function 'logpkt_pcap_build':
logpkt.c:351:3: warning: converting a packed 'ip4_hdr_t' {aka 'struct <anonymous>'} pointer (alignment 1) to a 'uint16_t' {aka 'short unsigned int'} pointer (alignment 2) may result in an unaligned pointer value [-Waddress-of-packed-member]
351 | CHKSUM_ADD_RANGE(sum, ip4_hdr, sizeof(ip4_hdr_t));
| ^~~~~~~~~~~~~~~~
logpkt.c:81:9: note: defined here
81 | typedef struct __attribute__((packed)) {
| ^~~~~~
logpkt.c:399:2: warning: converting a packed 'tcp_hdr_t' {aka 'struct <anonymous>'} pointer (alignment 1) to a 'uint16_t' {aka 'short unsigned int'} pointer (alignment 2) may result in an unaligned pointer value [-Waddress-of-packed-member]
399 | CHKSUM_ADD_RANGE(sum, tcp_hdr, sizeof(tcp_hdr_t) + payloadlen);
| ^~~~~~~~~~~~~~~~
logpkt.c:103:9: note: defined here
103 | typedef struct __attribute__((packed)) {
| ^~~~~~
For build problems, please supply:
Output of uname -a
Linux thinkpad.nohats.ca 5.2.9-200.fc30.x86_64 #1 SMP Fri Aug 16 21:37:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Yes, I can confirm this issue on Kali Linux 2019.3, which uses gcc 9.2.1 on kernel 5.2 too (I assume this issue is due to gcc). Removing the packed attribute on lines 81 and 103 in logpkt.c fixes it, but I think Daniel should decide on the correct fix.
Btw, adding aligned(2) attribute along with packed also silences this warning. But I don't think that's the correct fix either. The discussion here explains the issue.
For build problems, please supply:
uname -a
make
including the headeropenssl-1.1.1c-2.fc30.x86_64
libevent-2.1.8-5.fc30.x86_64
The text was updated successfully, but these errors were encountered: