diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-08-20 01:13:02 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-01 17:00:27 +0200 |
commit | 64c0f20ab3f8744bbab1fd83a4c44d11d116f99b (patch) | |
tree | 682040cbc5fd13357e093276280b915fb4716c47 | |
parent | 77c72b31ed26f22171130243077f8519f83b50c4 (diff) | |
download | passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar.gz passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar.bz2 passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar.lz passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar.xz passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.tar.zst passt-64c0f20ab3f8744bbab1fd83a4c44d11d116f99b.zip |
arp: Don't resolve own, configured IPv4 address
DHCP clients might try to resolve the assigned address to check if it's
already in use: don't resolve the configured IPv4 address.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | arp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -63,6 +63,10 @@ int arp(struct ctx *c, struct ethhdr *eh, size_t len) if (*((uint32_t *)&am->sip) && !memcmp(am->sip, am->tip, 4)) return 1; + /* Don't resolve our own address, either. */ + if (!memcmp(am->tip, &c->addr4, 4)) + return 1; + ah->ar_op = htons(ARPOP_REPLY); memcpy(am->tha, am->sha, ETH_ALEN); memcpy(am->sha, c->mac, ETH_ALEN); |