mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 11:13:50 +00:00
netns_ifaddrs: only use struct rtnl_link_stats64
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
da5efb6f76
commit
3ccf815f79
@ -233,16 +233,13 @@ static int nl_msg_to_ifaddr(void *pctx, bool *netnsid_aware, struct nlmsghdr *h)
|
|||||||
#if HAVE_STRUCT_RTNL_LINK_STATS64
|
#if HAVE_STRUCT_RTNL_LINK_STATS64
|
||||||
case IFLA_STATS64:
|
case IFLA_STATS64:
|
||||||
ifs->ifa.ifa_stats_type = IFLA_STATS64;
|
ifs->ifa.ifa_stats_type = IFLA_STATS64;
|
||||||
memcpy(&ifs->ifa.ifa_stats64, __RTA_DATA(rta),
|
|
||||||
__RTA_DATALEN(rta));
|
|
||||||
break;
|
|
||||||
#else
|
#else
|
||||||
case IFLA_STATS:
|
case IFLA_STATS:
|
||||||
ifs->ifa.ifa_stats_type = 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));
|
__RTA_DATALEN(rta));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case IFLA_MTU:
|
case IFLA_MTU:
|
||||||
memcpy(&ifs->ifa.ifa_mtu, __RTA_DATA(rta),
|
memcpy(&ifs->ifa.ifa_mtu, __RTA_DATA(rta),
|
||||||
sizeof(int));
|
sizeof(int));
|
||||||
|
@ -40,8 +40,11 @@ struct netns_ifaddrs {
|
|||||||
|
|
||||||
/* These fields are not present struct ifaddrs. */
|
/* These fields are not present struct ifaddrs. */
|
||||||
int ifa_stats_type;
|
int ifa_stats_type;
|
||||||
struct rtnl_link_stats ifa_stats32;
|
#if HAVE_STRUCT_RTNL_LINK_STATS64
|
||||||
struct rtnl_link_stats64 ifa_stats64;
|
struct rtnl_link_stats64 ifa_stats;
|
||||||
|
#else
|
||||||
|
struct rtnl_link_stats ifa_stats;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#define __ifa_broadaddr ifa_ifu.ifu_broadaddr
|
#define __ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||||
|
Loading…
Reference in New Issue
Block a user