Merge "Include iface index in the netlink event" am: a026a176ff
am: cc5234b494
Change-Id: I1f3f786f29096999eb55d909818c4b4815f8f61f
diff --git a/libsysutils/src/NetlinkEvent.cpp b/libsysutils/src/NetlinkEvent.cpp
index 7f92904..35a3063 100644
--- a/libsysutils/src/NetlinkEvent.cpp
+++ b/libsysutils/src/NetlinkEvent.cpp
@@ -137,6 +137,12 @@
switch(rta->rta_type) {
case IFLA_IFNAME:
asprintf(&mParams[0], "INTERFACE=%s", (char *) RTA_DATA(rta));
+ // We can get the interface change information from sysfs update
+ // already. But in case we missed those message when devices start.
+ // We do a update again when received a kLinkUp event. To make
+ // the message consistent, use IFINDEX here as well since sysfs
+ // uses IFINDEX.
+ asprintf(&mParams[1], "IFINDEX=%d", ifi->ifi_index);
mAction = (ifi->ifi_flags & IFF_LOWER_UP) ? Action::kLinkUp :
Action::kLinkDown;
mSubsystem = strdup("net");