kernel-netlink: Set usable state whenever an interface appears

If an interface is renamed we already have an entry (based on the
ifindex) allocated but previously only set the usable state once
based on the original name.

Fixes #2403.
This commit is contained in:
Tobias Brunner 2017-08-14 17:26:08 +02:00
parent b7ad5f777f
commit 062a34e722
1 changed files with 2 additions and 2 deletions

View File

@ -1183,13 +1183,13 @@ static void process_link(private_kernel_netlink_net_t *this,
INIT(entry,
.ifindex = msg->ifi_index,
.addrs = linked_list_create(),
.usable = charon->kernel->is_interface_usable(
charon->kernel, name),
);
this->ifaces->insert_last(this->ifaces, entry);
}
strncpy(entry->ifname, name, IFNAMSIZ);
entry->ifname[IFNAMSIZ-1] = '\0';
entry->usable = charon->kernel->is_interface_usable(charon->kernel,
name);
if (event && entry->usable)
{
if (!(entry->flags & IFF_UP) && (msg->ifi_flags & IFF_UP))