net: if: Lower ram usage for IP address lifetime handling

Instead of having one delayed_work struct / IP address, use
only one delayed_work struct for lifetime timer. This saves
over 20 bytes / allocated address struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2018-08-17 10:20:05 +03:00
commit eeabc2ba3d
4 changed files with 141 additions and 17 deletions

View file

@ -49,8 +49,16 @@ struct net_if_addr {
/** IP address */
struct net_addr address;
/** Timer that triggers renewal */
struct k_delayed_work lifetime;
#if defined(CONFIG_NET_IPV6)
/** Used for track timers */
sys_snode_t node;
/** Address lifetime timer start time */
s64_t lifetime_timer_start;
/** lifetime timer timeout */
u32_t lifetime_timer_timeout;
#endif
#if defined(CONFIG_NET_IPV6_DAD)
/** Duplicate address detection (DAD) timer */