From d0a79ff0850ca3008716bf96b9f9689fd6248194 Mon Sep 17 00:00:00 2001 From: sg Date: Tue, 19 Jul 2016 22:01:42 +0200 Subject: [PATCH] fixed bug #48477 (ARP input packet might update static entry) --- CHANGELOG | 3 +++ src/core/ipv4/etharp.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 65b33d2d..263d19e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -321,6 +321,9 @@ HISTORY ++ Bugfixes: + 2016-07-19: Simon Goldschmidt + * etharp.c: fixed bug #48477 (ARP input packet might update static entry) + 2016-07-11: Simon Goldschmidt * tcp_in.c: fixed bug #48476 (TCP sent callback called wrongly due to picking up old pcb->acked diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c index 28d33cc8..5481d3bd 100644 --- a/src/core/ipv4/etharp.c +++ b/src/core/ipv4/etharp.c @@ -480,6 +480,9 @@ etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct et if (flags & ETHARP_FLAG_STATIC_ENTRY) { /* record static type */ arp_table[i].state = ETHARP_STATE_STATIC; + } else if (arp_table[i].state == ETHARP_STATE_STATIC) { + /* found entry is a static type, don't overwrite it */ + return ERR_VAL; } else #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ {