lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] issue adding static arp entries.


From: Joel Cunningham
Subject: Re: [lwip-users] issue adding static arp entries.
Date: Tue, 19 Dec 2017 16:21:24 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0



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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]