diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2013-11-19 18:38:16 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-19 18:38:16 -0800 |
commit | 6231f7f07b1d2476e57410d5b8f7cbed72b893b7 (patch) | |
tree | d33e03424abf1775fbae8a018efe415fdffbb038 | |
parent | ee676317b0d5b98968b8dc99d34b2ec0e60180ab (diff) | |
parent | 71dd5ba4647fdecde0a44793f246fb0274159cbe (diff) | |
download | system_core-6231f7f07b1d2476e57410d5b8f7cbed72b893b7.zip system_core-6231f7f07b1d2476e57410d5b8f7cbed72b893b7.tar.gz system_core-6231f7f07b1d2476e57410d5b8f7cbed72b893b7.tar.bz2 |
am 71dd5ba4: Merge "Switch back to subsystem "net" for netlink events."
* commit '71dd5ba4647fdecde0a44793f246fb0274159cbe':
Switch back to subsystem "net" for netlink events.
-rw-r--r-- | include/sysutils/NetlinkEvent.h | 2 | ||||
-rw-r--r-- | libsysutils/src/NetlinkEvent.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/sysutils/NetlinkEvent.h b/include/sysutils/NetlinkEvent.h index 2a734cb..f3501cf 100644 --- a/include/sysutils/NetlinkEvent.h +++ b/include/sysutils/NetlinkEvent.h @@ -34,6 +34,8 @@ public: const static int NlActionChange; const static int NlActionLinkDown; const static int NlActionLinkUp; + const static int NlActionAddressUpdated; + const static int NlActionAddressRemoved; NetlinkEvent(); virtual ~NetlinkEvent(); diff --git a/libsysutils/src/NetlinkEvent.cpp b/libsysutils/src/NetlinkEvent.cpp index 01bec77..aae2ae7 100644 --- a/libsysutils/src/NetlinkEvent.cpp +++ b/libsysutils/src/NetlinkEvent.cpp @@ -42,6 +42,8 @@ const int NetlinkEvent::NlActionRemove = 2; const int NetlinkEvent::NlActionChange = 3; const int NetlinkEvent::NlActionLinkUp = 4; const int NetlinkEvent::NlActionLinkDown = 5; +const int NetlinkEvent::NlActionAddressUpdated = 6; +const int NetlinkEvent::NlActionAddressRemoved = 7; NetlinkEvent::NetlinkEvent() { mAction = NlActionUnknown; @@ -131,11 +133,12 @@ bool NetlinkEvent::parseIfAddrMessage(int type, struct ifaddrmsg *ifaddr, } // Fill in interface information. - mAction = (type == RTM_NEWADDR) ? NlActionAdd : NlActionRemove; - mSubsystem = strdup("address"); + mAction = (type == RTM_NEWADDR) ? NlActionAddressUpdated : + NlActionAddressRemoved; + mSubsystem = strdup("net"); asprintf(&mParams[0], "ADDRESS=%s/%d", addrstr, ifaddr->ifa_prefixlen); - asprintf(&mParams[1], "IFACE=%s", ifname); + asprintf(&mParams[1], "INTERFACE=%s", ifname); asprintf(&mParams[2], "FLAGS=%u", ifaddr->ifa_flags); asprintf(&mParams[3], "SCOPE=%u", ifaddr->ifa_scope); } else if (rta->rta_type == IFA_CACHEINFO) { @@ -205,7 +208,7 @@ bool NetlinkEvent::parseBinaryNetlinkMessage(char *buffer, int size) { mParams[0] = strdup(buffer); mAction = (ifi->ifi_flags & IFF_LOWER_UP) ? NlActionLinkUp : NlActionLinkDown; - mSubsystem = strdup("interface"); + mSubsystem = strdup("net"); break; } |