summaryrefslogtreecommitdiffstats
path: root/discover/network.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-16 10:49:29 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-12-18 09:52:42 +0800
commitb955fa07fc256b39caedb311f97fed404a63c8d5 (patch)
tree7e1e464163453eef09988287b2d0d3c40038a553 /discover/network.c
parent8b09f179fb71f13223e78ceb91f6a692053957b0 (diff)
downloadtalos-petitboot-b955fa07fc256b39caedb311f97fed404a63c8d5.tar.gz
talos-petitboot-b955fa07fc256b39caedb311f97fed404a63c8d5.zip
sysinfo: Add interface link status to sysinfo data
This changes adds a 'link' parameter to the interface information sent in sysinfo messages. The discover network code populates this from the incoming netlink messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/network.c')
-rw-r--r--discover/network.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/discover/network.c b/discover/network.c
index bc7e186..7ddecc0 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -416,14 +416,15 @@ static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
memcpy(interface->hwaddr, ifaddr, sizeof(interface->hwaddr));
strncpy(interface->name, ifname, sizeof(interface->name) - 1);
add_interface(network, interface);
-
- /* tell the sysinfo code about this interface */
- if (strcmp(interface->name, "lo"))
- system_info_register_interface(
- sizeof(interface->hwaddr),
- interface->hwaddr, interface->name);
}
+ /* notify the sysinfo code about changes to this interface */
+ if (strcmp(interface->name, "lo"))
+ system_info_register_interface(
+ sizeof(interface->hwaddr),
+ interface->hwaddr, interface->name,
+ info->ifi_flags & IFF_LOWER_UP);
+
configure_interface(network, interface,
info->ifi_flags & IFF_UP,
info->ifi_flags & IFF_LOWER_UP);
OpenPOWER on IntegriCloud