On 12/19/2017 1:59 PM, Kent Pluntze wrote:
Hello,
I am trying to create a network with limited traffic so I am
attempting to initialize all ARP tables to static. Currently I am
calling a function in the application which does the following.
makeArpTableStatic(void){
/*inits*/
int i;
u8_t count = 0;
u8_t entry_ret = 0;
s8_t ret =0;
ip_addr_t **ip_addr_ret = NULL;
struct netif **netif = NULL;
struct eth_addr **eth_ret = NULL;
for(i=0; i<ARP_TABLE_SIZE; i++){
count = (u8_t) i;
entry_ret= etharp_get_entry(count, ip_addr_ret, netif, eth_ret);
if( entry_ret == 1){
ret = etharp_add_static_entry(*ip_addr_ret, *eth_ret);
These are RAW APIs that may not be safe to be called from application
code depending on your system and LwIP's configuration. See
http://www.nongnu.org/lwip/2_0_x/pitfalls.html
#ifdef DEBUG_ON
printf("return of %d = %d\n",i ,ret);
#endif
}
ip_addr_ret = NULL;
netif = NULL;
eth_ret = NULL;
}
}/*eof*/
This code crashes when it reaches etharp_add_static_entry. It runs if
that function is removed. currently there are no other ways to make an
entry static from the application layer. Any help you could offer
would be appreciated.
We added thread safe ARP cache APIs in git master (though there's not a
getter, only add/remove). See
http://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=c47d161d4a8946028fff6143160e9f58d1a4be49
Joel
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users