Merge "Parse IfIndex for Netlink RTM_NEWADDR / RTM_DELADDR event"

This commit is contained in:
Rubin Xu 2018-06-27 16:27:26 +00:00 committed by Gerrit Code Review
commit 6effd4d6a3
1 changed files with 5 additions and 4 deletions

View File

@ -239,12 +239,13 @@ bool NetlinkEvent::parseIfAddrMessage(const struct nlmsghdr *nh) {
asprintf(&mParams[1], "INTERFACE=%s", ifname);
asprintf(&mParams[2], "FLAGS=%u", ifaddr->ifa_flags);
asprintf(&mParams[3], "SCOPE=%u", ifaddr->ifa_scope);
asprintf(&mParams[4], "IFINDEX=%u", ifaddr->ifa_index);
if (cacheinfo) {
asprintf(&mParams[4], "PREFERRED=%u", cacheinfo->ifa_prefered);
asprintf(&mParams[5], "VALID=%u", cacheinfo->ifa_valid);
asprintf(&mParams[6], "CSTAMP=%u", cacheinfo->cstamp);
asprintf(&mParams[7], "TSTAMP=%u", cacheinfo->tstamp);
asprintf(&mParams[5], "PREFERRED=%u", cacheinfo->ifa_prefered);
asprintf(&mParams[6], "VALID=%u", cacheinfo->ifa_valid);
asprintf(&mParams[7], "CSTAMP=%u", cacheinfo->cstamp);
asprintf(&mParams[8], "TSTAMP=%u", cacheinfo->tstamp);
}
return true;