diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-02-28 22:17:32 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-02-28 22:17:32 +0100 |
commit | 2fa1cef0167ca330a2d1abd865c3e465cd032230 (patch) | |
tree | b4082750da9ec030ee95e4c1490fb2b0f927429a /arp.c | |
parent | 213c397492bdc64cf26b2e7b3877e4a29dc9f8da (diff) | |
download | passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar.gz passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar.bz2 passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar.lz passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar.xz passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.tar.zst passt-2fa1cef0167ca330a2d1abd865c3e465cd032230.zip |
arp, dhcp: Fix strict aliasing warnings reported by gcc 4.9 with -Ofast
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'arp.c')
-rw-r--r-- | arp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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. */ |