/* updates the next hop the lifetime and the interface id for a given entry  */
static int fib_upd_entry(fib_entry_t *entry, uint8_t *next_hop, size_t next_hop_size, uint32_t next_hop_flags, uint32_t lifetime)
/* updates the next hop the lifetime and the interface id for a given entry  */
static int fib_upd_entry(fib_entry_t *entry, uint8_t *next_hop, size_t next_hop_size, uint32_t next_hop_flags, uint32_t lifetime)
{
    universal_address_container_t *container = universal_address_add(next_hop, next_hop_size);
    if (container == NULL) {
        return -ENOMEM;
    }
    universal_address_rem(entry->next_hop);
    entry->next_hop = container;
    entry->next_hop_flags = next_hop_flags;
    if (lifetime != (uint32_t)FIB_LIFETIME_NO_EXPIRE) {
        fib_lifetime_to_absolute(lifetime, &entry->lifetime);
    }
    else {
        entry->lifetime = FIB_LIFETIME_NO_EXPIRE;
    }
    return 0;
}