Index: api/sockets.c
===================================================================
RCS file: /sources/lwip/lwip/src/api/sockets.c,v
retrieving revision 1.54
diff -u -r1.54 sockets.c
--- api/sockets.c	1 Jun 2007 17:15:54 -0000	1.54
+++ api/sockets.c	5 Jun 2007 11:16:50 -0000
@@ -1350,7 +1350,7 @@
   data.optname = optname;
   data.optval = (void*)optval;
   data.optlen = &optlen;
-  tcpip_callback(lwip_getsockopt_internal, &data);
+  tcpip_callback(lwip_setsockopt_internal, &data);
   sys_arch_mbox_fetch(sock->conn->mbox, NULL, 0);
 
   sock_set_errno(sock, err);
Index: core/dhcp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/dhcp.c,v
retrieving revision 1.65
diff -u -r1.65 dhcp.c
--- core/dhcp.c	4 Apr 2007 19:54:23 -0000	1.65
+++ core/dhcp.c	5 Jun 2007 11:16:53 -0000
@@ -169,7 +169,7 @@
     (s16_t)netif->name[1]));
   /* create an ARP query for the offered IP address, expecting that no host
      responds, as the IP address should not be in use. */
-  result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);
+  result = etharp_query(netif, &dhcp->offered_ip_addr, NULL, NULL);
   if (result != ERR_OK) {
     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_check: could not perform ARP query\n"));
   }
Index: core/netif.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/netif.c,v
retrieving revision 1.49
diff -u -r1.49 netif.c
--- core/netif.c	30 Mar 2007 09:25:41 -0000	1.49
+++ core/netif.c	5 Jun 2007 11:16:53 -0000
@@ -307,7 +307,7 @@
      *  ARP cache. From RFC 3220 "IP Mobility Support for IPv4" section 4.6.
      */ 
     if (netif->flags & NETIF_FLAG_ETHARP) {
-      etharp_query(netif, &(netif->ip_addr), NULL);
+      etharp_query(netif, &(netif->ip_addr), NULL, NULL);
     }
 #endif /* LWIP_ARP */
     
Index: core/raw.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/raw.c,v
retrieving revision 1.11
diff -u -r1.11 raw.c
--- core/raw.c	22 May 2007 07:31:06 -0000	1.11
+++ core/raw.c	5 Jun 2007 11:16:53 -0000
@@ -248,7 +248,7 @@
     src_ip = &(pcb->local_ip);
   }
 
-  err = ip_output_if (q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif);
+  err = ip_output_if (q, src_ip, ipaddr, pcb->ttl, pcb->tos, pcb->protocol, netif, &(pcb->addr_hint));
 
   /* did we chain a header earlier? */
   if (q != p) {
Index: core/tcp_out.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/tcp_out.c,v
retrieving revision 1.51
diff -u -r1.51 tcp_out.c
--- core/tcp_out.c	10 May 2007 05:20:05 -0000	1.51
+++ core/tcp_out.c	5 Jun 2007 11:16:53 -0000
@@ -439,7 +439,7 @@
           IP_PROTO_TCP, p->tot_len);
 #endif
     ip_output(p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
-        IP_PROTO_TCP);
+        IP_PROTO_TCP, &(pcb->addr_hint));
     pbuf_free(p);
 
     return ERR_OK;
@@ -582,7 +582,7 @@
   TCP_STATS_INC(tcp.xmit);
 
   ip_output(seg->p, &(pcb->local_ip), &(pcb->remote_ip), pcb->ttl, pcb->tos,
-      IP_PROTO_TCP);
+      IP_PROTO_TCP, &(pcb->addr_hint));
 }
 
 void
@@ -616,7 +616,7 @@
   TCP_STATS_INC(tcp.xmit);
   snmp_inc_tcpoutrsts();
    /* Send output with hardcoded TTL since we have no access to the pcb */
-  ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP);
+  ip_output(p, local_ip, remote_ip, TCP_TTL, 0, IP_PROTO_TCP, NULL);
   pbuf_free(p);
   LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
 }
@@ -714,7 +714,7 @@
   TCP_STATS_INC(tcp.xmit);
 
    /* Send output to IP */
-  ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP);
+  ip_output(p, &pcb->local_ip, &pcb->remote_ip, pcb->ttl, 0, IP_PROTO_TCP, &(pcb->addr_hint));
 
   pbuf_free(p);
 
Index: core/udp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/udp.c,v
retrieving revision 1.85
diff -u -r1.85 udp.c
--- core/udp.c	4 Jun 2007 10:42:03 -0000	1.85
+++ core/udp.c	5 Jun 2007 11:16:54 -0000
@@ -378,7 +378,6 @@
       if (q != p) {
         /* free the header pbuf */
         pbuf_free(q);
-        q = NULL;
         /* p is still referenced by the caller, and will live on */
       }
       return ERR_VAL;
@@ -406,7 +405,7 @@
 #endif
     /* output to IP */
     LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDPLITE,)\n"));
-    err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);    
+    err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif, &pcb->addr_hint);
   } else {      /* UDP */
     LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %"U16_F"\n", q->tot_len));
     udphdr->len = htons(q->tot_len);
@@ -423,7 +422,7 @@
     LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP checksum 0x%04"X16_F"\n", udphdr->chksum));
     LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
     /* output to IP */
-    err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);    
+    err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif, &pcb->addr_hint);
   }
   /* TODO: must this be increased even if error occured? */
   snmp_inc_udpoutdatagrams();
Index: core/ipv4/icmp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/icmp.c,v
retrieving revision 1.31
diff -u -r1.31 icmp.c
--- core/ipv4/icmp.c	3 Jun 2007 17:18:33 -0000	1.31
+++ core/ipv4/icmp.c	5 Jun 2007 11:16:51 -0000
@@ -158,7 +158,7 @@
       LWIP_ASSERT("Can't move over header in packet", 0);
     else
       ip_output_if(p, &(iphdr->src), IP_HDRINCL,
-                   ICMP_TTL, 0, IP_PROTO_ICMP, inp);
+                   ICMP_TTL, 0, IP_PROTO_ICMP, inp, NULL);
     break;
   default:
     LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" code %"S16_F" not supported.\n", 
@@ -216,7 +216,7 @@
   /* increase number of destination unreachable messages attempted to send */
   snmp_inc_icmpoutdestunreachs();
 
-  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP);
+  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP, NULL);
   pbuf_free(q);
 }
 
@@ -259,7 +259,7 @@
   snmp_inc_icmpoutmsgs();
   /* increase number of destination unreachable messages attempted to send */
   snmp_inc_icmpouttimeexcds();
-  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP);
+  ip_output(q, NULL, &(iphdr->src), ICMP_TTL, 0, IP_PROTO_ICMP, NULL);
   pbuf_free(q);
 }
 
Index: core/ipv4/igmp.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/igmp.c,v
retrieving revision 1.5
diff -u -r1.5 igmp.c
--- core/ipv4/igmp.c	16 May 2007 14:12:52 -0000	1.5
+++ core/ipv4/igmp.c	4 Jun 2007 07:25:10 -0000
@@ -463,7 +463,7 @@
 
   LWIP_DEBUGF(IGMP_DEBUG, ("IGMP sending to netif %x \n", (int) netif));
 
-  return netif->output (netif, p, dest);
+  return netif->output (netif, p, dest, NULL);
 }
 
 /*-----------------------------------------------------------------------------
Index: core/ipv4/ip.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/ip.c,v
retrieving revision 1.46
diff -u -r1.46 ip.c
--- core/ipv4/ip.c	3 Jun 2007 18:36:42 -0000	1.46
+++ core/ipv4/ip.c	5 Jun 2007 11:16:51 -0000
@@ -161,7 +161,7 @@
 
   PERF_STOP("ip_forward");
   /* transmit pbuf on chosen interface */
-  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest));
+  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest), NULL);
   return netif;
 }
 #endif /* IP_FORWARD */
@@ -433,7 +433,7 @@
 err_t
 ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
              u8_t ttl, u8_t tos,
-             u8_t proto, struct netif *netif)
+             u8_t proto, struct netif *netif, u8_t *addr_hint)
 {
   struct ip_hdr *iphdr;
   static u16_t ip_id = 0;
@@ -493,7 +493,7 @@
 
   LWIP_DEBUGF(IP_DEBUG, ("netif->output()"));
 
-  return netif->output(netif, p, dest);
+  return netif->output(netif, p, dest, addr_hint);
 }
 
 /**
@@ -507,7 +507,7 @@
  */
 err_t
 ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
-          u8_t ttl, u8_t tos, u8_t proto)
+          u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint)
 {
   struct netif *netif;
 
@@ -519,7 +519,7 @@
     return ERR_RTE;
   }
 
-  return ip_output_if(p, src, dest, ttl, tos, proto, netif);
+  return ip_output_if(p, src, dest, ttl, tos, proto, netif, addr_hint);
 }
 
 #if IP_DEBUG
Index: core/ipv4/ip_frag.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv4/ip_frag.c,v
retrieving revision 1.28
diff -u -r1.28 ip_frag.c
--- core/ipv4/ip_frag.c	3 Jun 2007 18:36:42 -0000	1.28
+++ core/ipv4/ip_frag.c	5 Jun 2007 11:16:51 -0000
@@ -59,7 +59,7 @@
 static u8_t ip_reasstmr;
 #endif /* IP_REASSEMBLY */
 
-#if IP_REASSEMBLY || IP_FRAG_USES_STATIC_BUF
+#if IP_REASSEMBLY || (IP_FRAG && IP_FRAG_USES_STATIC_BUF)
 /*
  * Copy len bytes from offset in pbuf to buffer 
  *
@@ -449,7 +449,7 @@
     header = pbuf_alloc(PBUF_LINK, 0, PBUF_RAM);
     if (header != NULL) {
       pbuf_chain(header, rambuf);
-      netif->output(netif, header, dest);
+      netif->output(netif, header, dest, NULL);
       IPFRAG_STATS_INC(ip_frag.xmit);
       snmp_inc_ipfragcreates();
       pbuf_free(header);
@@ -462,7 +462,7 @@
     /* No need for separate header pbuf - we allowed room for it in rambuf
      * when allocated.
      */
-    netif->output(netif, rambuf, dest);
+    netif->output(netif, rambuf, dest, NULL);
     IPFRAG_STATS_INC(ip_frag.xmit);
 
     /* Unfortunately we can't reuse rambuf - the hardware may still be
Index: core/ipv6/ip6.c
===================================================================
RCS file: /sources/lwip/lwip/src/core/ipv6/ip6.c,v
retrieving revision 1.16
diff -u -r1.16 ip6.c
--- core/ipv6/ip6.c	10 Apr 2007 13:18:14 -0000	1.16
+++ core/ipv6/ip6.c	5 Jun 2007 11:16:52 -0000
@@ -140,7 +140,7 @@
 
   PERF_STOP("ip_forward");
 
-  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest));
+  netif->output(netif, p, (struct ip_addr *)&(iphdr->dest), NULL);
 }
 
 /* ip_input:
@@ -311,7 +311,7 @@
 #endif /* IP_DEBUG */
 
   PERF_STOP("ip_output_if");
-  return netif->output(netif, p, dest);
+  return netif->output(netif, p, dest, NULL);
 }
 
 /* ip_output:
Index: include/ipv4/lwip/ip.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/ipv4/lwip/ip.h,v
retrieving revision 1.21
diff -u -r1.21 ip.h
--- include/ipv4/lwip/ip.h	17 May 2007 12:22:11 -0000	1.21
+++ include/ipv4/lwip/ip.h	5 Jun 2007 11:16:55 -0000
@@ -49,10 +49,10 @@
 struct netif *ip_route(struct ip_addr *dest);
 err_t ip_input(struct pbuf *p, struct netif *inp);
 err_t ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
-    u8_t ttl, u8_t tos, u8_t proto);
+    u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint);
 err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
        u8_t ttl, u8_t tos, u8_t proto,
-       struct netif *netif);
+       struct netif *netif, u8_t *addr_hint);
 
 #define IP_HLEN 20
 
@@ -83,7 +83,9 @@
    /* Type Of Service */ \
   u8_t tos;              \
   /* Time To Live */     \
-  u8_t ttl
+  u8_t ttl;              \
+  /* link layer address resolution hint */ \
+  u8_t addr_hint
 
 /*
  * Option flags per-socket. These are the same like SO_XXX.
Index: include/ipv6/lwip/ip.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/ipv6/lwip/ip.h,v
retrieving revision 1.10
diff -u -r1.10 ip.h
--- include/ipv6/lwip/ip.h	3 Jun 2007 18:10:38 -0000	1.10
+++ include/ipv6/lwip/ip.h	5 Jun 2007 11:16:57 -0000
@@ -69,7 +69,9 @@
    /* Type Of Service */ \
   u8_t tos;              \
   /* Time To Live */     \
-  u8_t ttl
+  u8_t ttl;              \
+  /* link layer address resolution hint */ \
+  u8_t addr_hint
 
 
 /* The IPv6 header. */
Index: include/lwip/mem.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/mem.h,v
retrieving revision 1.13
diff -u -r1.13 mem.h
--- include/lwip/mem.h	11 May 2007 19:42:14 -0000	1.13
+++ include/lwip/mem.h	4 Jun 2007 07:25:14 -0000
@@ -68,7 +68,13 @@
 #else /* MEM_LIBC_MALLOC */
 /* lwIP alternative malloc */
 void mem_init(void);
+//#define MEM_MALLOC_TRACE_USER
+#ifdef MEM_MALLOC_TRACE_USER
+void *mem_malloc_fn(mem_size_t size, const char *file, int line);
+#define mem_malloc(s) mem_malloc_fn((s), __FILE__, __LINE__)
+#else
 void *mem_malloc(mem_size_t size);
+#endif
 void mem_free(void *mem);
 void *mem_realloc(void *mem, mem_size_t size);
 #endif /* MEM_LIBC_MALLOC */
Index: include/lwip/netif.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/netif.h,v
retrieving revision 1.31
diff -u -r1.31 netif.h
--- include/lwip/netif.h	17 May 2007 12:49:02 -0000	1.31
+++ include/lwip/netif.h	4 Jun 2007 07:25:14 -0000
@@ -94,7 +94,7 @@
    *  to send a packet on the interface. This function typically
    *  first resolves the hardware address, then sends the packet. */
   err_t (* output)(struct netif *netif, struct pbuf *p,
-       struct ip_addr *ipaddr);
+       struct ip_addr *ipaddr, u8_t *addr_hint);
   /** This function is called by the ARP module when it wants
    *  to send a packet on the interface. This function outputs
    *  the pbuf as-is on the link medium. */
Index: include/lwip/pbuf.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/lwip/pbuf.h,v
retrieving revision 1.23
diff -u -r1.23 pbuf.h
--- include/lwip/pbuf.h	4 Jun 2007 09:54:58 -0000	1.23
+++ include/lwip/pbuf.h	4 Jun 2007 07:25:14 -0000
@@ -110,7 +110,9 @@
 void pbuf_cat(struct pbuf *h, struct pbuf *t);
 void pbuf_chain(struct pbuf *h, struct pbuf *t);
 struct pbuf *pbuf_dechain(struct pbuf *p);
+#if ARP_QUEUEING
 err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from);
+#endif
 
 #ifdef __cplusplus
 }
Index: include/netif/etharp.h
===================================================================
RCS file: /sources/lwip/lwip/src/include/netif/etharp.h,v
retrieving revision 1.28
diff -u -r1.28 etharp.h
--- include/netif/etharp.h	10 May 2007 10:59:20 -0000	1.28
+++ include/netif/etharp.h	4 Jun 2007 07:25:15 -0000
@@ -135,9 +135,9 @@
 void etharp_ip_input(struct netif *netif, struct pbuf *p);
 void etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr,
          struct pbuf *p);
-err_t etharp_output(struct netif *netif, struct ip_addr *ipaddr,
-         struct pbuf *q);
-err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q);
+err_t etharp_output(struct netif *netif, struct pbuf *q, 
+         struct ip_addr *ipaddr, u8_t *addr_hint);
+err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q, u8_t *addr_hint);
 err_t etharp_request(struct netif *netif, struct ip_addr *ipaddr);
 
 #ifdef __cplusplus
Index: netif/etharp.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/etharp.c,v
retrieving revision 1.109
diff -u -r1.109 etharp.c
--- netif/etharp.c	1 Jun 2007 17:11:47 -0000	1.109
+++ netif/etharp.c	5 Jun 2007 11:17:02 -0000
@@ -104,7 +104,7 @@
 
 static const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
 static struct etharp_entry arp_table[ARP_TABLE_SIZE];
-static u8_t etharp_cached_entry = 0;
+//static u8_t etharp_cached_entry = 0;
 
 /**
  * Try hard to create a new entry - we want the IP address to appear in
@@ -112,7 +112,7 @@
 #define ETHARP_TRY_HARD 1
 #define ETHARP_FIND_ONLY  2
 
-static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags);
+static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, u8_t *addr_hint);
 static err_t update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags);
 /**
  * Initializes ARP module.
@@ -222,7 +222,7 @@
  * @return The ARP entry index that matched or is created, ERR_MEM if no
  * entry is found or could be recycled.
  */
-static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags)
+static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags, u8_t *addr_hint)
 {
   s8_t old_pending = ARP_TABLE_SIZE, old_stable = ARP_TABLE_SIZE;
   s8_t empty = ARP_TABLE_SIZE;
@@ -238,11 +238,14 @@
    * same address. If so, we're really fast! */
   if (ipaddr) {
     /* ipaddr to search for was given */
-    if (arp_table[etharp_cached_entry].state == ETHARP_STATE_STABLE) {
-      /* the cached entry is stable */
-      if (ip_addr_cmp(ipaddr, &arp_table[etharp_cached_entry].ipaddr)) {
-        /* cached entry was the right one! */
-        return etharp_cached_entry;
+    if ((addr_hint != NULL) && (*addr_hint < ARP_TABLE_SIZE)) {
+      /* addr_hint was given and is in range */
+      if (arp_table[*addr_hint].state == ETHARP_STATE_STABLE) {
+        /* the cached entry is stable */
+        if (ip_addr_cmp(ipaddr, &arp_table[*addr_hint].ipaddr)) {
+          /* cached entry was the right one! */
+          return *addr_hint;
+        }
       }
     }
   }
@@ -275,7 +278,8 @@
       if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
         LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: found matching pending entry %"U16_F"\n", (u16_t)i));
         /* found exact IP address match, simply bail out */
-        etharp_cached_entry = i;
+        if (addr_hint)
+          *addr_hint = i;
         return i;
 #if ARP_QUEUEING
       /* pending with queued packets? */
@@ -299,7 +303,8 @@
       if (ipaddr && ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
         LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("find_entry: found matching stable entry %"U16_F"\n", (u16_t)i));
         /* found exact IP address match, simply bail out */
-        etharp_cached_entry = i;
+        if (addr_hint)
+          *addr_hint = i;
         return i;
       /* remember entry with oldest stable entry in oldest, its age in maxtime */
       } else if (arp_table[i].ctime >= age_stable) {
@@ -311,7 +316,7 @@
   /* { we have no match } => try to create a new entry */
    
   /* no empty entry found and not allowed to recycle? */
-  if ((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_TRY_HARD) == 0)
+  if (((empty == ARP_TABLE_SIZE) && ((flags & ETHARP_TRY_HARD) == 0))
       /* or don't create new entry, only search? */
       || ((flags & ETHARP_FIND_ONLY) != 0))
   {
@@ -376,7 +381,8 @@
     ip_addr_set(&arp_table[i].ipaddr, ipaddr);
   }
   arp_table[i].ctime = 0;
-  etharp_cached_entry = i;
+  if (addr_hint)
+    *addr_hint = i;
   return (err_t)i;
 }
 
@@ -418,7 +424,7 @@
     return ERR_ARG;
   }
   /* find or create ARP entry */
-  i = find_entry(ipaddr, flags);
+  i = find_entry(ipaddr, flags, NULL);
   /* bail out if no entry could be found */
   if (i < 0)
     return (err_t)i;
@@ -490,7 +496,7 @@
 {
   s8_t i;
 
-  i = find_entry(ipaddr, ETHARP_FIND_ONLY);
+  i = find_entry(ipaddr, ETHARP_FIND_ONLY, NULL);
   if((i >= 0) && arp_table[i].state == ETHARP_STATE_STABLE) {
       *eth_ret = &arp_table[i].ethaddr;
       *ip_ret = &arp_table[i].ipaddr;
@@ -681,7 +687,7 @@
  * or the return type of either etharp_query() or netif->linkoutput().
  */
 err_t
-etharp_output(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
+etharp_output(struct netif *netif, struct pbuf *q, struct ip_addr *ipaddr, u8_t *addr_hint)
 {
   struct eth_addr *dest, *srcaddr, mcastaddr;
   struct eth_hdr *ethhdr;
@@ -730,7 +736,7 @@
       }
     }
     /* queue on destination Ethernet address belonging to ipaddr */
-    return etharp_query(netif, ipaddr, q);
+    return etharp_query(netif, ipaddr, q, addr_hint);
   }
 
   /* continuation for multicast/broadcast destinations */
@@ -781,7 +787,7 @@
  * - ERR_ARG Non-unicast address given, those will not appear in ARP cache.
  *
  */
-err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
+err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q, u8_t *addr_hint)
 {
   struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr;
   err_t result = ERR_MEM;
@@ -797,7 +803,7 @@
   }
 
   /* find entry in ARP cache, ask to create entry if queueing packet */
-  i = find_entry(ipaddr, ETHARP_TRY_HARD);
+  i = find_entry(ipaddr, ETHARP_TRY_HARD, addr_hint);
 
   /* could not find or create entry? */
   if (i < 0)
Index: netif/ethernetif.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/ethernetif.c,v
retrieving revision 1.30
diff -u -r1.30 ethernetif.c
--- netif/ethernetif.c	4 May 2007 15:14:14 -0000	1.30
+++ netif/ethernetif.c	5 Jun 2007 11:17:02 -0000
@@ -58,22 +58,22 @@
 static const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
 
 /* Forward declarations. */
-static void  ethernetif_input(struct netif *netif);
+void  ethernetif_input(struct netif *netif);
 static err_t ethernetif_output(struct netif *netif, struct pbuf *p,
-             struct ip_addr *ipaddr);
+             struct ip_addr *ipaddr, u8_t *addr_hint);
 
 static void
 low_level_init(struct netif *netif)
 {
-  struct ethernetif *ethernetif = netif->state;
+  //struct ethernetif *ethernetif = netif->state;
   
   /* set MAC hardware address length */
   netif->hwaddr_len = 6;
 
   /* set MAC hardware address */
-  netif->hwaddr[0] = ;
+  /*netif->hwaddr[0] = ;
   ...
-  netif->hwaddr[5] = ;
+  netif->hwaddr[5] = ;*/
 
   /* maximum transfer unit */
   netif->mtu = 1500;
@@ -97,10 +97,10 @@
 static err_t
 low_level_output(struct netif *netif, struct pbuf *p)
 {
-  struct ethernetif *ethernetif = netif->state;
+  //struct ethernetif *ethernetif = netif->state;
   struct pbuf *q;
 
-  initiate transfer();
+  //initiate transfer();
   
 #if ETH_PAD_SIZE
   pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
@@ -110,10 +110,10 @@
     /* Send the data from the pbuf to the interface, one pbuf at a
        time. The size of the data in each pbuf is kept in the ->len
        variable. */
-    send data from(q->payload, q->len);
+    //send data from(q->payload, q->len);
   }
 
-  signal that packet should be sent();
+  //signal that packet should be sent();
 
 #if ETH_PAD_SIZE
   pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
@@ -137,13 +137,13 @@
 static struct pbuf *
 low_level_input(struct netif *netif)
 {
-  struct ethernetif *ethernetif = netif->state;
+  //struct ethernetif *ethernetif = netif->state;
   struct pbuf *p, *q;
   u16_t len;
 
   /* Obtain the size of the packet and put it into the "len"
      variable. */
-  len = ;
+  //len = ;
 
 #if ETH_PAD_SIZE
   len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
@@ -164,9 +164,9 @@
       /* Read enough bytes to fill this pbuf in the chain. The
        * available data in the pbuf is given by the q->len
        * variable. */
-      read data into(q->payload, q->len);
+      //read data into(q->payload, q->len);
     }
-    acknowledge that packet has been read();
+    //acknowledge that packet has been read();
 
 #if ETH_PAD_SIZE
     pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
@@ -176,7 +176,7 @@
     lwip_stats.link.recv++;
 #endif /* LINK_STATS */      
   } else {
-    drop packet();
+    //drop packet();
 #if LINK_STATS
     lwip_stats.link.memerr++;
     lwip_stats.link.drop++;
@@ -197,11 +197,11 @@
 
 static err_t
 ethernetif_output(struct netif *netif, struct pbuf *p,
-      struct ip_addr *ipaddr)
+      struct ip_addr *ipaddr, u8_t *addr_hint)
 {
   
  /* resolve hardware address, then send (or queue) packet */
-  return etharp_output(netif, ipaddr, p);
+  return etharp_output(netif, p, ipaddr, addr_hint);
  
 }
 
@@ -215,7 +215,7 @@
  *
  */
 
-static void
+void
 ethernetif_input(struct netif *netif)
 {
   struct ethernetif *ethernetif;
Index: netif/loopif.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/loopif.c,v
retrieving revision 1.17
diff -u -r1.17 loopif.c
--- netif/loopif.c	17 May 2007 08:55:50 -0000	1.17
+++ netif/loopif.c	4 Jun 2007 07:25:18 -0000
@@ -99,7 +99,7 @@
 
 static err_t
 loopif_output(struct netif *netif, struct pbuf *p,
-       struct ip_addr *ipaddr)
+       struct ip_addr *ipaddr, u8_t *addr_hint)
 {
 #if !LWIP_LOOPIF_MULTITHREADING
   SYS_ARCH_DECL_PROTECT(lev);
Index: netif/slipif.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/slipif.c,v
retrieving revision 1.21
diff -u -r1.21 slipif.c
--- netif/slipif.c	17 May 2007 09:02:30 -0000	1.21
+++ netif/slipif.c	4 Jun 2007 07:25:18 -0000
@@ -57,7 +57,7 @@
  * Uses the serial layer's sio_send() 
  */
 err_t
-slipif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
+slipif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr, u8_t *addr_hint)
 {
   struct pbuf *q;
   u16_t i;
Index: netif/ppp/ppp.c
===================================================================
RCS file: /sources/lwip/lwip/src/netif/ppp/ppp.c,v
retrieving revision 1.13
diff -u -r1.13 ppp.c
--- netif/ppp/ppp.c	10 May 2007 05:20:06 -0000	1.13
+++ netif/ppp/ppp.c	4 Jun 2007 07:25:18 -0000
@@ -537,7 +537,7 @@
 }
 
 /* Send a packet on the given connection. */
-static err_t pppifOutput(struct netif *netif, struct pbuf *pb, struct ip_addr *ipaddr)
+static err_t pppifOutput(struct netif *netif, struct pbuf *pb, struct ip_addr *ipaddr, u8_t *addr_hint)
 {
     int pd = (int)netif->state;
     u_short protocol = PPP_IP;

