]> granicus.if.org Git - strace/commit
rtnl_link: use internal rtnl_link_stats* and ifla_port_vsi definitions
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 10 Oct 2019 09:08:51 +0000 (11:08 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 19 Oct 2019 15:58:22 +0000 (17:58 +0200)
commit55c18c05b8e5fc1f96907b437bfb666fee9ecdb1
treed93377eba61562ec62b4702dcf8fbd6f376c8dab
parentf1d273a003c25de827f6aba4727adaed6ae9b176
rtnl_link: use internal rtnl_link_stats* and ifla_port_vsi definitions

Define substitutes for struct rtnl_link_stats, struct
rtnl_link_stats64, and struct ifla_port_vsi internally.
Add a static_assert that informs about future growth of the structures
provided by the kernel headers.

* rtnl_link.c (struct_rtnl_link_stats, struct_rtnl_link_stats64,
struct_ifla_port_vsi): New typedefs.
[HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]: Add a static_assert to check
that sizeof(struct rtnl_link_stats) has the expected value.
[HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Add a static_assert
to check that sizeof(struct rtnl_link_stats) has the expected value.
[HAVE_STRUCT_IFLA_PORT_VSI]: Add a static_assert to check
that sizeof(struct ifla_port_vsi) has the expected value.
(decode_rtnl_link_stats) [HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER]:
Remove guard.
(decode_rtnl_link_stats): Change the type of st variable to
struct_rtnl_link_stats; use struct_rtnl_link_stats in offsetofend
statement for min_size definition.
(decode_rtnl_link_stats64) [HAVE_STRUCT_RTNL_LINK_STATS64,
HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER]: Remove guards.
(decode_rtnl_link_stats64): Change the type of st variable
to struct_rtnl_link_stats64.
(decode_ifla_port_vsi) [HAVE_STRUCT_IFLA_PORT_VSI]: Remove guard.
(decode_ifla_port_vsi): Change the type of vsi variable
to struct_ifla_port_vsi.

References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
rtnl_link.c