mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
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().
This commit is contained in:
1 parent
12c15603ed
commit
025e1a186b
1 file changed
+6
@@ -89,6 +89,7 @@ volatile __xdata uint32_t ticks;
|
|||||||
volatile __xdata uint8_t sec_counter;
|
volatile __xdata uint8_t sec_counter;
|
||||||
volatile __xdata uint16_t sleep_ticks;
|
volatile __xdata uint16_t sleep_ticks;
|
||||||
__xdata uint8_t stp_clock;
|
__xdata uint8_t stp_clock;
|
||||||
|
__xdata uint8_t arp_age_secs;
|
||||||
extern __xdata struct dhcp_state dhcp_state;
|
extern __xdata struct dhcp_state dhcp_state;
|
||||||
|
|
||||||
#define STP_TICK_DIVIDER 3
|
#define STP_TICK_DIVIDER 3
|
||||||
@@ -1565,6 +1566,11 @@ void idle(void)
|
|||||||
|
|
||||||
// Check for button presses once a second
|
// Check for button presses once a second
|
||||||
handle_button();
|
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
|
#ifdef DEBUG
|
||||||
print_sfr_data();
|
print_sfr_data();
|
||||||
|
|||||||
Reference in new issue
Block a user