From: Ethan Jackson Date: Fri, 14 Oct 2011 22:39:49 +0000 (-0700) Subject: rtnetlink-link: Expose carrier changes. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a37fdc4444d57dd20b5d7a180e68f9e7195d164;p=openvswitch rtnetlink-link: Expose carrier changes. This will be used in a future commit. --- diff --git a/lib/rtnetlink-link.c b/lib/rtnetlink-link.c index 0a40ceaf..7d26d866 100644 --- a/lib/rtnetlink-link.c +++ b/lib/rtnetlink-link.c @@ -63,6 +63,7 @@ rtnetlink_link_parse(struct ofpbuf *buf, change->nlmsg_type = nlmsg->nlmsg_type; change->ifi_index = ifinfo->ifi_index; change->ifname = nl_attr_get_string(attrs[IFLA_IFNAME]); + change->running = ifinfo->ifi_flags & IFF_RUNNING; change->master_ifindex = (attrs[IFLA_MASTER] ? nl_attr_get_u32(attrs[IFLA_MASTER]) : 0); diff --git a/lib/rtnetlink-link.h b/lib/rtnetlink-link.h index 23f1ef27..24a77286 100644 --- a/lib/rtnetlink-link.h +++ b/lib/rtnetlink-link.h @@ -37,6 +37,7 @@ struct rtnetlink_link_change { /* Extracted from Netlink attributes. */ const char *ifname; /* Name of network device. */ int master_ifindex; /* Ifindex of datapath master (0 if none). */ + bool running; /* Carrier of network device. */ }; /* Function called to report that a netdev has changed. 'change' describes the