mirror of
https://passt.top/passt
synced 2025-06-18 13:05:35 +02:00
arp, dhcp: Fix strict aliasing warnings reported by gcc 4.9 with -Ofast
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
213c397492
commit
2fa1cef016
2 changed files with 9 additions and 8 deletions
3
arp.c
3
arp.c
|
@ -58,7 +58,8 @@ int arp(struct ctx *c, struct ethhdr *eh, size_t len)
|
|||
/* Discard announcements (but not 0.0.0.0 "probes"): we might have the
|
||||
* same IP address, hide that.
|
||||
*/
|
||||
if (*((uint32_t *)&am->sip) && !memcmp(am->sip, am->tip, 4))
|
||||
if (memcmp(am->sip, (unsigned char[4]){ 0, 0, 0, 0 }, 4) &&
|
||||
!memcmp(am->sip, am->tip, 4))
|
||||
return 1;
|
||||
|
||||
/* Don't resolve our own address, either. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue