[Top][All Lists]

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

[lwip-devel] [task #14724] thread safe ARP cache APIs

From: Joel Cunningham
Subject: [lwip-devel] [task #14724] thread safe ARP cache APIs
Date: Thu, 16 Nov 2017 14:31:21 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

Follow-up Comment #11, task #14724 (project lwip):

> Hmm, to me, everything but sockets and the like (e.g. netdb, if_api) is
meant to use lwIP structures (e.g. ip_addr_t, struct eth_addr, etc). In this
context, a netif is identified by its struct netif. 

Your point makes sense, the one thing I think about is that the struct netif
pointer can really only safely be used by the code that owns that instance of
struct netif (which is typically the link-layer) because as you've mentioned,
there is a race holding a pointer when the netif could be removed by the
link-layer code (even worse if struct netif was dynamically allocated and now
it points to free memory).

Using some kind of opaque identifier like index or handle avoids these race

> Given that, we probably should leave out the netif pointer altogether for
now, since it's not used right now, anyway. Or do you need it?

Nope don't need it, I was just exploring your idea of including it :)  I'll
remove it and get my patch submitted.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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