lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #14314] Implement interface name/index APIs


From: Dirk Ziegelmeier
Subject: [lwip-devel] [task #14314] Implement interface name/index APIs
Date: Fri, 20 Jan 2017 07:09:18 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #2, task #14314 (project lwip):

/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at
0 */
#define netif_num_to_index(netif)   ((netif)->num + 1)
#define netif_index_to_num(index)   ((index) - 1)

Converting netif->num to index unfortunately is not that easy, because netifs
can be added and removed at runtime. netif->num increases and may wrap around,
and may therefore not even be unique. This needs to be fixed first.

I frequently forget that they may be added/removed at runtime, e.g. in the
IPv6 scopes discussion, because I use lwIP in systems where the netifs are
created only once during startup.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?14314>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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