From 025e1a186b94bfae24d976a7d6da7f62283f90f7 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Sun, 6 Sep 2026 18:05:29 +0200 Subject: [PATCH] Call uip_arp_timer() so the ARP cache ages uip_arp_timer() was defined but never called, so ARP entries were only refreshed on new learning and only removed under table pressure. A cached entry for a peer whose MAC later changes (a gateway failover, a replaced device) is then used until it is evicted, and traffic to anything reached through it is sent to the old MAC and lost, while on-link traffic is unaffected. uIP expects the timer roughly every ten seconds; drive it from the once-per-second housekeeping in idle(). --- rtlplayground.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rtlplayground.c b/rtlplayground.c index b3710c76..f9da5839 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -89,6 +89,7 @@ volatile __xdata uint32_t ticks; volatile __xdata uint8_t sec_counter; volatile __xdata uint16_t sleep_ticks; __xdata uint8_t stp_clock; +__xdata uint8_t arp_age_secs; extern __xdata struct dhcp_state dhcp_state; #define STP_TICK_DIVIDER 3 @@ -1565,6 +1566,11 @@ void idle(void) // Check for button presses once a second handle_button(); + // Age the ARP cache: uip_arp_timer() expects a 10 s cadence + if (++arp_age_secs >= 10) { + arp_age_secs = 0; + uip_arp_timer(); + } #ifdef DEBUG print_sfr_data();