netns_ifaddrs: only use struct rtnl_link_stats64

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-09-30 20:58:06 +02:00
parent da5efb6f76
commit 3ccf815f79
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
2 changed files with 7 additions and 7 deletions

View File

@ -233,16 +233,13 @@ static int nl_msg_to_ifaddr(void *pctx, bool *netnsid_aware, struct nlmsghdr *h)
#if HAVE_STRUCT_RTNL_LINK_STATS64
case IFLA_STATS64:
ifs->ifa.ifa_stats_type = IFLA_STATS64;
memcpy(&ifs->ifa.ifa_stats64, __RTA_DATA(rta),
__RTA_DATALEN(rta));
break;
#else
case IFLA_STATS:
ifs->ifa.ifa_stats_type = IFLA_STATS;
memcpy(&ifs->ifa.ifa_stats32, __RTA_DATA(rta),
#endif
memcpy(&ifs->ifa.ifa_stats, __RTA_DATA(rta),
__RTA_DATALEN(rta));
break;
#endif
case IFLA_MTU:
memcpy(&ifs->ifa.ifa_mtu, __RTA_DATA(rta),
sizeof(int));

View File

@ -40,8 +40,11 @@ struct netns_ifaddrs {
/* These fields are not present struct ifaddrs. */
int ifa_stats_type;
struct rtnl_link_stats ifa_stats32;
struct rtnl_link_stats64 ifa_stats64;
#if HAVE_STRUCT_RTNL_LINK_STATS64
struct rtnl_link_stats64 ifa_stats;
#else
struct rtnl_link_stats ifa_stats;
#endif
};
#define __ifa_broadaddr ifa_ifu.ifu_broadaddr