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>
This commit is contained in:
4
arp.c
4
arp.c
@@ -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))
|
if (*((uint32_t *)&am->sip) && !memcmp(am->sip, am->tip, 4))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
/* Don't resolve our own address, either. */
|
||||||
|
if (!memcmp(am->tip, &c->addr4, 4))
|
||||||
|
return 1;
|
||||||
|
|
||||||
ah->ar_op = htons(ARPOP_REPLY);
|
ah->ar_op = htons(ARPOP_REPLY);
|
||||||
memcpy(am->tha, am->sha, ETH_ALEN);
|
memcpy(am->tha, am->sha, ETH_ALEN);
|
||||||
memcpy(am->sha, c->mac, ETH_ALEN);
|
memcpy(am->sha, c->mac, ETH_ALEN);
|
||||||
|
Reference in New Issue
Block a user