 src/include/netif/etharp.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/include/netif/etharp.h b/src/include/netif/etharp.h
index 2eda148..c0c5a66 100644
--- a/src/include/netif/etharp.h
+++ b/src/include/netif/etharp.h
@@ -131,8 +131,8 @@ PACK_STRUCT_END
 #define SIZEOF_ETHARP_HDR 28
 #define SIZEOF_ETHARP_PACKET (SIZEOF_ETH_HDR + SIZEOF_ETHARP_HDR)
 
-/** 5 seconds period */
-#define ARP_TMR_INTERVAL 5000
+/** 1 seconds period */
+#define ARP_TMR_INTERVAL 1000
 
 #define ETHTYPE_ARP       0x0806U
 #define ETHTYPE_IP        0x0800U

 
 src/netif/etharp.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/netif/etharp.c b/src/netif/etharp.c
index 8b333dd..fc18f8a 100644
--- a/src/netif/etharp.c
+++ b/src/netif/etharp.c
@@ -74,22 +74,22 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}};
 #if LWIP_ARP /* don't build if not configured for use in lwipopts.h */
 
 /** the time an ARP entry stays valid after its last update,
- *  for ARP_TMR_INTERVAL = 5000, this is
- *  (240 * 5) seconds = 20 minutes.
+ *  for ARP_TMR_INTERVAL = 1000, this is
+ *  (60 * 20) seconds = 20 minutes.
  */
-#define ARP_MAXAGE              240
+#define ARP_MAXAGE              (60*20)
 /** Re-request a used ARP entry 1 minute before it would expire to prevent
  *  breaking a steadily used connection because the ARP entry timed out. */
-#define ARP_AGE_REREQUEST_USED  (ARP_MAXAGE - 12)
+#define ARP_AGE_REREQUEST_USED  (ARP_MAXAGE - 60)
 
 /** the time an ARP entry stays pending after first request,
- *  for ARP_TMR_INTERVAL = 5000, this is
- *  (2 * 5) seconds = 10 seconds.
+ *  for ARP_TMR_INTERVAL = 1000, this is
+ *  10 seconds.
  * 
  *  @internal Keep this number at least 2, otherwise it might
  *  run out instantly if the timeout occurs directly after a request.
  */
-#define ARP_MAXPENDING 2
+#define ARP_MAXPENDING 10
 
 #define HWTYPE_ETHERNET 1
 
@@ -112,9 +112,7 @@ struct etharp_entry {
   struct pbuf *q;
 #endif /* ARP_QUEUEING */
   ip_addr_t ipaddr;
-#if LWIP_SNMP
   struct netif *netif;
-#endif /* LWIP_SNMP */
   struct eth_addr ethaddr;
   u8_t state;
   u8_t ctime;
@@ -193,9 +191,7 @@ etharp_free_entry(int i)
 #ifdef LWIP_DEBUG
   /* for debugging, clean out the complete entry */
   arp_table[i].ctime = 0;
-#if LWIP_SNMP
   arp_table[i].netif = NULL;
-#endif /* LWIP_SNMP */
   ip_addr_set_zero(&arp_table[i].ipaddr);
   arp_table[i].ethaddr = ethzero;
 #endif /* LWIP_DEBUG */
@@ -236,12 +232,12 @@ etharp_tmr(void)
            re-send an ARP request. */
         arp_table[i].state = ETHARP_STATE_STABLE;
       }
-#if ARP_QUEUEING
       /* still pending entry? (not expired) */
-      if (arp_table[i].state == ETHARP_STATE_PENDING) {
+      else if (arp_table[i].state == ETHARP_STATE_PENDING) {
         /* resend an ARP query here? */
+        if (etharp_request(arp_table[i].netif, &arp_table[i].ipaddr) != ERR_OK) {
+        }
       }
-#endif /* ARP_QUEUEING */
     }
   }
 }
@@ -484,9 +480,7 @@ etharp_update_arp_entry(struct netif *netif, ip_addr_t *ipaddr, struct eth_addr
   }
 
   /* record network interface */
-#if LWIP_SNMP
   arp_table[i].netif = netif;
-#endif /* LWIP_SNMP */
   /* insert in SNMP ARP index tree */
   snmp_insert_arpidx_tree(netif, &arp_table[i].ipaddr);
 
@@ -1007,6 +1001,7 @@ etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
 {
   struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
   err_t result = ERR_MEM;
+  int is_new_entry = 0;
   s8_t i; /* ARP entry index */
 
   /* non-unicast address? */
@@ -1032,7 +1027,10 @@ etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
 
   /* mark a fresh entry as pending (we just sent a request) */
   if (arp_table[i].state == ETHARP_STATE_EMPTY) {
+    is_new_entry = 1;
     arp_table[i].state = ETHARP_STATE_PENDING;
+    /* record network interface for re-sending arp request in etharp_tmr */
+    arp_table[i].netif = netif;
   }
 
   /* { i is either a STABLE or (new or existing) PENDING entry } */
@@ -1040,8 +1038,8 @@ etharp_query(struct netif *netif, ip_addr_t *ipaddr, struct pbuf *q)
   ((arp_table[i].state == ETHARP_STATE_PENDING) ||
    (arp_table[i].state >= ETHARP_STATE_STABLE)));
 
-  /* do we have a pending entry? or an implicit query request? */
-  if ((arp_table[i].state == ETHARP_STATE_PENDING) || (q == NULL)) {
+  /* do we have a new entry? or an implicit query request? */
+  if (is_new_entry || (q == NULL)) {
     /* try to resolve it; send out ARP request */
     result = etharp_request(netif, ipaddr);
     if (result != ERR_OK) {
