Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
cb06ba8b
Unverified
Commit
cb06ba8b
authored
Sep 30, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netns_ifaddrs: only use struct rtnl_link_stats64
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
1f470bd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
netns_ifaddrs.c
src/include/netns_ifaddrs.c
+2
-5
netns_ifaddrs.h
src/include/netns_ifaddrs.h
+5
-2
No files found.
src/include/netns_ifaddrs.c
View file @
cb06ba8b
...
@@ -233,16 +233,13 @@ static int nl_msg_to_ifaddr(void *pctx, bool *netnsid_aware, struct nlmsghdr *h)
...
@@ -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
));
...
...
src/include/netns_ifaddrs.h
View file @
cb06ba8b
...
@@ -40,8 +40,11 @@ struct netns_ifaddrs {
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment