|
|
86f512 |
From 9099fc83708c5329a705b4cf91cffd3bcd17929c Mon Sep 17 00:00:00 2001
|
|
|
86f512 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
86f512 |
Date: Thu, 10 Oct 2019 13:58:44 +0200
|
|
|
86f512 |
Subject: [PATCH 65/76] rtnl_mdb: decode messages regardless of availability of
|
|
|
86f512 |
kernel headers
|
|
|
86f512 |
|
|
|
86f512 |
* netlink_route.c [!HAVE_STRUCT_BR_PORT_MSG]: Do not skip decoding of
|
|
|
86f512 |
RTM_DELMDB, RTM_GETMDB, and RTM_NEWMDB messages.
|
|
|
86f512 |
* rtnl_mdb.c: Remove #ifdef HAVE_STRUCT_BR_PORT_MSG guard.
|
|
|
86f512 |
(struct_br_port_msg, struct_br_mdb_entry): New typedefs.
|
|
|
86f512 |
[HAVE_STRUCT_BR_PORT_MSG]: Static assert check for struct br_port_msg
|
|
|
86f512 |
size.
|
|
|
86f512 |
[HAVE_STRUCT_BR_NDB_ENTRY]: Static assert check for strucr br_mdb_entry
|
|
|
86f512 |
size.
|
|
|
86f512 |
(decode_mdba_mdb_entry_info) [!HAVE_STRUCT_BR_MDB_ENTRY]: Remove.
|
|
|
86f512 |
(decode_mdba_mdb_entry_info): Change entry type to struct_br_mdb_entry.
|
|
|
86f512 |
(decode_mdba_mdb_entry_info) [HAVE_STRUCT_BR_MDB_ENTRY_FLAGS,
|
|
|
86f512 |
HAVE_STRUCT_BR_MDB_ENTRY_VID]: Remove guards.
|
|
|
86f512 |
(decode_br_port_msg): Change bpm type to struct_br_port_msg.
|
|
|
86f512 |
* tests/nlattr_ifinfomsg.c: Use TEST_NLATTR_OBJECT_MINSZ to test
|
|
|
86f512 |
struct rtnl_link_stats printing.
|
|
|
86f512 |
* tests/nlattr_mdba_mdb_entry.c: Update expected output.
|
|
|
86f512 |
|
|
|
86f512 |
References: https://bugzilla.redhat.com/show_bug.cgi?id=1758201
|
|
|
86f512 |
---
|
|
|
86f512 |
netlink_route.c | 2 --
|
|
|
86f512 |
rtnl_mdb.c | 83 +++++++++++++++++++++++++++----------------
|
|
|
86f512 |
tests/nlattr_ifinfomsg.c | 60 +++++++++++++++----------------
|
|
|
86f512 |
tests/nlattr_mdba_mdb_entry.c | 8 +++++
|
|
|
86f512 |
4 files changed, 89 insertions(+), 64 deletions(-)
|
|
|
86f512 |
|
|
|
86f512 |
Index: strace-5.1/netlink_route.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/netlink_route.c 2018-12-25 00:46:43.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/netlink_route.c 2020-01-29 12:37:03.065060270 +0100
|
|
|
86f512 |
@@ -90,11 +90,9 @@
|
|
|
86f512 |
[RTM_NEWNETCONF - RTM_BASE] = decode_netconfmsg,
|
|
|
86f512 |
#endif
|
|
|
86f512 |
|
|
|
86f512 |
-#ifdef HAVE_STRUCT_BR_PORT_MSG
|
|
|
86f512 |
[RTM_DELMDB - RTM_BASE] = decode_br_port_msg,
|
|
|
86f512 |
[RTM_GETMDB - RTM_BASE] = decode_br_port_msg,
|
|
|
86f512 |
[RTM_NEWMDB - RTM_BASE] = decode_br_port_msg,
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
|
|
|
86f512 |
[RTM_DELNSID - RTM_BASE] = decode_rtgenmsg,
|
|
|
86f512 |
[RTM_GETNSID - RTM_BASE] = decode_rtgenmsg,
|
|
|
86f512 |
Index: strace-5.1/rtnl_mdb.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/rtnl_mdb.c 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/rtnl_mdb.c 2020-01-29 12:37:03.066060261 +0100
|
|
|
86f512 |
@@ -9,27 +9,52 @@
|
|
|
86f512 |
|
|
|
86f512 |
#include "defs.h"
|
|
|
86f512 |
|
|
|
86f512 |
+#include "netlink_route.h"
|
|
|
86f512 |
+#include "nlattr.h"
|
|
|
86f512 |
+#include "print_fields.h"
|
|
|
86f512 |
+
|
|
|
86f512 |
+#include <netinet/in.h>
|
|
|
86f512 |
+#include <linux/if_bridge.h>
|
|
|
86f512 |
+#include "netlink.h"
|
|
|
86f512 |
+
|
|
|
86f512 |
+#include "xlat/mdb_flags.h"
|
|
|
86f512 |
+#include "xlat/mdb_states.h"
|
|
|
86f512 |
+#include "xlat/multicast_router_types.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdb_attrs.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdba_mdb_attrs.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdba_mdb_eattr_attrs.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdba_mdb_entry_attrs.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdba_router_attrs.h"
|
|
|
86f512 |
+#include "xlat/rtnl_mdba_router_pattr_attrs.h"
|
|
|
86f512 |
+
|
|
|
86f512 |
+typedef struct {
|
|
|
86f512 |
+ uint8_t family;
|
|
|
86f512 |
+ uint32_t ifindex;
|
|
|
86f512 |
+} struct_br_port_msg;
|
|
|
86f512 |
+
|
|
|
86f512 |
+typedef struct {
|
|
|
86f512 |
+ uint32_t ifindex;
|
|
|
86f512 |
+ uint8_t state;
|
|
|
86f512 |
+ uint8_t flags;
|
|
|
86f512 |
+ uint16_t vid;
|
|
|
86f512 |
+ struct {
|
|
|
86f512 |
+ union {
|
|
|
86f512 |
+ uint32_t /* __be32 */ ip4;
|
|
|
86f512 |
+ struct in6_addr ip6;
|
|
|
86f512 |
+ } u;
|
|
|
86f512 |
+ uint16_t /* __be16 */ proto;
|
|
|
86f512 |
+ } addr;
|
|
|
86f512 |
+} struct_br_mdb_entry;
|
|
|
86f512 |
+
|
|
|
86f512 |
#ifdef HAVE_STRUCT_BR_PORT_MSG
|
|
|
86f512 |
+static_assert(sizeof(struct br_port_msg) <= sizeof(struct_br_port_msg),
|
|
|
86f512 |
+ "Unexpected struct br_port_msg size, please update the decoder");
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
|
|
|
86f512 |
-# include "netlink_route.h"
|
|
|
86f512 |
-# include "nlattr.h"
|
|
|
86f512 |
-# include "print_fields.h"
|
|
|
86f512 |
-
|
|
|
86f512 |
-# include <netinet/in.h>
|
|
|
86f512 |
-# include <linux/if_bridge.h>
|
|
|
86f512 |
-# include "netlink.h"
|
|
|
86f512 |
-
|
|
|
86f512 |
-# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
-# include "xlat/mdb_flags.h"
|
|
|
86f512 |
-# endif
|
|
|
86f512 |
-# include "xlat/mdb_states.h"
|
|
|
86f512 |
-# include "xlat/multicast_router_types.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdb_attrs.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdba_mdb_attrs.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdba_mdb_eattr_attrs.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdba_mdb_entry_attrs.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdba_router_attrs.h"
|
|
|
86f512 |
-# include "xlat/rtnl_mdba_router_pattr_attrs.h"
|
|
|
86f512 |
+#ifdef HAVE_STRUCT_BR_NDB_ENTRY
|
|
|
86f512 |
+static_assert(sizeof(struct br_mdb_entry) <= sizeof(struct_br_mdb_entry),
|
|
|
86f512 |
+ "Unexpected struct br_mdb_entry size, please update the decoder");
|
|
|
86f512 |
+#endif
|
|
|
86f512 |
|
|
|
86f512 |
static const nla_decoder_t mdba_mdb_eattr_nla_decoders[] = {
|
|
|
86f512 |
[MDBA_MDB_EATTR_TIMER] = decode_nla_u32
|
|
|
86f512 |
@@ -41,21 +66,22 @@
|
|
|
86f512 |
const unsigned int len,
|
|
|
86f512 |
const void *const opaque_data)
|
|
|
86f512 |
{
|
|
|
86f512 |
-# ifdef HAVE_STRUCT_BR_MDB_ENTRY
|
|
|
86f512 |
- struct br_mdb_entry entry;
|
|
|
86f512 |
+ struct_br_mdb_entry entry;
|
|
|
86f512 |
|
|
|
86f512 |
if (len < sizeof(entry))
|
|
|
86f512 |
return false;
|
|
|
86f512 |
else if (!umove_or_printaddr(tcp, addr, &entry)) {
|
|
|
86f512 |
PRINT_FIELD_IFINDEX("{", entry, ifindex);
|
|
|
86f512 |
PRINT_FIELD_XVAL(", ", entry, state, mdb_states, "MDB_???");
|
|
|
86f512 |
-# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
+
|
|
|
86f512 |
+ /*
|
|
|
86f512 |
+ * Note that it's impossible to derive if flags/vid fields
|
|
|
86f512 |
+ * are present on all architectures except m68k; as a side note,
|
|
|
86f512 |
+ * v4.3-rc1~96^2~365 has introduced an ABI breakage on m68k.
|
|
|
86f512 |
+ */
|
|
|
86f512 |
PRINT_FIELD_FLAGS(", ", entry, flags,
|
|
|
86f512 |
mdb_flags, "MDB_FLAGS_???");
|
|
|
86f512 |
-# endif
|
|
|
86f512 |
-# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
-# endif
|
|
|
86f512 |
|
|
|
86f512 |
const int proto = ntohs(entry.addr.proto);
|
|
|
86f512 |
|
|
|
86f512 |
@@ -77,9 +103,6 @@
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
return true;
|
|
|
86f512 |
-# else
|
|
|
86f512 |
- return false;
|
|
|
86f512 |
-# endif /* HAVE_STRUCT_BR_MDB_ENTRY */
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
static const nla_decoder_t mdba_mdb_entry_nla_decoders[] = {
|
|
|
86f512 |
@@ -185,7 +208,7 @@
|
|
|
86f512 |
|
|
|
86f512 |
DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg)
|
|
|
86f512 |
{
|
|
|
86f512 |
- struct br_port_msg bpm = { .family = family };
|
|
|
86f512 |
+ struct_br_port_msg bpm = { .family = family };
|
|
|
86f512 |
size_t offset = sizeof(bpm.family);
|
|
|
86f512 |
bool decode_nla = false;
|
|
|
86f512 |
|
|
|
86f512 |
@@ -212,5 +235,3 @@
|
|
|
86f512 |
ARRAY_SIZE(br_port_msg_nla_decoders), NULL);
|
|
|
86f512 |
}
|
|
|
86f512 |
}
|
|
|
86f512 |
-
|
|
|
86f512 |
-#endif
|
|
|
86f512 |
Index: strace-5.1/tests/nlattr_ifinfomsg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests/nlattr_ifinfomsg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests/nlattr_ifinfomsg.c 2020-01-29 12:37:03.068060243 +0100
|
|
|
86f512 |
@@ -118,40 +118,39 @@
|
|
|
86f512 |
IFLA_LINK_NETNSID, pattern, netnsid,
|
|
|
86f512 |
printf("%d", netnsid));
|
|
|
86f512 |
|
|
|
86f512 |
- TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
|
|
86f512 |
- init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
- IFLA_STATS, pattern, st,
|
|
|
86f512 |
- PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
+ const unsigned int sizeof_stats =
|
|
|
86f512 |
+ offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_MINSZ(fd, nlh0, hdrlen,
|
|
|
86f512 |
+ init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
+ IFLA_STATS, pattern, st, sizeof_stats,
|
|
|
86f512 |
+ PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
#endif
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
|
|
|
86f512 |
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- const unsigned int sizeof_stats =
|
|
|
86f512 |
- offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
TEST_NLATTR(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
IFLA_STATS, sizeof_stats, &st, sizeof_stats,
|
|
|
86f512 |
@@ -179,7 +178,6 @@
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
-#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */
|
|
|
86f512 |
|
|
|
86f512 |
static const struct rtnl_link_ifmap map = {
|
|
|
86f512 |
.mem_start = 0xadcbefedefbcdedb,
|
|
|
86f512 |
Index: strace-5.1/tests/nlattr_mdba_mdb_entry.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests/nlattr_mdba_mdb_entry.c 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests/nlattr_mdba_mdb_entry.c 2020-01-29 12:37:03.072060206 +0100
|
|
|
86f512 |
@@ -122,9 +122,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u,
|
|
|
86f512 |
@@ -145,9 +149,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u));
|
|
|
86f512 |
Index: strace-5.1/tests-m32/nlattr_ifinfomsg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-m32/nlattr_ifinfomsg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-m32/nlattr_ifinfomsg.c 2020-01-29 12:37:24.526863268 +0100
|
|
|
86f512 |
@@ -118,40 +118,39 @@
|
|
|
86f512 |
IFLA_LINK_NETNSID, pattern, netnsid,
|
|
|
86f512 |
printf("%d", netnsid));
|
|
|
86f512 |
|
|
|
86f512 |
- TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
|
|
86f512 |
- init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
- IFLA_STATS, pattern, st,
|
|
|
86f512 |
- PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
+ const unsigned int sizeof_stats =
|
|
|
86f512 |
+ offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_MINSZ(fd, nlh0, hdrlen,
|
|
|
86f512 |
+ init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
+ IFLA_STATS, pattern, st, sizeof_stats,
|
|
|
86f512 |
+ PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
#endif
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
|
|
|
86f512 |
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- const unsigned int sizeof_stats =
|
|
|
86f512 |
- offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
TEST_NLATTR(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
IFLA_STATS, sizeof_stats, &st, sizeof_stats,
|
|
|
86f512 |
@@ -179,7 +178,6 @@
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
-#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */
|
|
|
86f512 |
|
|
|
86f512 |
static const struct rtnl_link_ifmap map = {
|
|
|
86f512 |
.mem_start = 0xadcbefedefbcdedb,
|
|
|
86f512 |
Index: strace-5.1/tests-m32/nlattr_mdba_mdb_entry.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-m32/nlattr_mdba_mdb_entry.c 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-m32/nlattr_mdba_mdb_entry.c 2020-01-29 12:37:24.583862745 +0100
|
|
|
86f512 |
@@ -122,9 +122,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u,
|
|
|
86f512 |
@@ -145,9 +149,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u));
|
|
|
86f512 |
Index: strace-5.1/tests-mx32/nlattr_ifinfomsg.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-mx32/nlattr_ifinfomsg.c 2018-12-30 16:35:21.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-mx32/nlattr_ifinfomsg.c 2020-01-29 12:37:24.529863241 +0100
|
|
|
86f512 |
@@ -118,40 +118,39 @@
|
|
|
86f512 |
IFLA_LINK_NETNSID, pattern, netnsid,
|
|
|
86f512 |
printf("%d", netnsid));
|
|
|
86f512 |
|
|
|
86f512 |
- TEST_NLATTR_OBJECT(fd, nlh0, hdrlen,
|
|
|
86f512 |
- init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
- IFLA_STATS, pattern, st,
|
|
|
86f512 |
- PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
+ const unsigned int sizeof_stats =
|
|
|
86f512 |
+ offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
+ TEST_NLATTR_OBJECT_MINSZ(fd, nlh0, hdrlen,
|
|
|
86f512 |
+ init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
+ IFLA_STATS, pattern, st, sizeof_stats,
|
|
|
86f512 |
+ PRINT_FIELD_U("{", st, rx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_packets);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_bytes);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_dropped);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, multicast);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, collisions);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_length_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_over_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_crc_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_frame_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_missed_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_aborted_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_carrier_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_fifo_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_heartbeat_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_window_errors);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
+ PRINT_FIELD_U(", ", st, rx_nohandler);
|
|
|
86f512 |
#endif
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
|
|
|
86f512 |
-#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER
|
|
|
86f512 |
- const unsigned int sizeof_stats =
|
|
|
86f512 |
- offsetofend(struct rtnl_link_stats, tx_compressed);
|
|
|
86f512 |
TEST_NLATTR(fd, nlh0, hdrlen,
|
|
|
86f512 |
init_ifinfomsg, print_ifinfomsg,
|
|
|
86f512 |
IFLA_STATS, sizeof_stats, &st, sizeof_stats,
|
|
|
86f512 |
@@ -179,7 +178,6 @@
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, rx_compressed);
|
|
|
86f512 |
PRINT_FIELD_U(", ", st, tx_compressed);
|
|
|
86f512 |
printf("}"));
|
|
|
86f512 |
-#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */
|
|
|
86f512 |
|
|
|
86f512 |
static const struct rtnl_link_ifmap map = {
|
|
|
86f512 |
.mem_start = 0xadcbefedefbcdedb,
|
|
|
86f512 |
Index: strace-5.1/tests-mx32/nlattr_mdba_mdb_entry.c
|
|
|
86f512 |
===================================================================
|
|
|
86f512 |
--- strace-5.1.orig/tests-mx32/nlattr_mdba_mdb_entry.c 2018-12-10 01:00:00.000000000 +0100
|
|
|
86f512 |
+++ strace-5.1/tests-mx32/nlattr_mdba_mdb_entry.c 2020-01-29 12:37:24.585862727 +0100
|
|
|
86f512 |
@@ -122,9 +122,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u,
|
|
|
86f512 |
@@ -145,9 +149,13 @@
|
|
|
86f512 |
printf(", state=MDB_TEMPORARY");
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS
|
|
|
86f512 |
printf(", flags=MDB_FLAGS_OFFLOAD");
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", flags=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID
|
|
|
86f512 |
PRINT_FIELD_U(", ", entry, vid);
|
|
|
86f512 |
+# else
|
|
|
86f512 |
+ printf(", vid=0");
|
|
|
86f512 |
# endif
|
|
|
86f512 |
printf(", addr={u=");
|
|
|
86f512 |
print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u));
|