]> granicus.if.org Git - strace/blobdiff - rtnl_link.c
tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c
[strace] / rtnl_link.c
index 2e13fce59a83cd27d70dec2858784330708de659..2ef2d63a4cddf05342493d76ff3f3b4fc8235bf2 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/rtnetlink.h>
 
 #include "xlat/rtnl_ifla_brport_attrs.h"
+#include "xlat/rtnl_ifla_events.h"
 #include "xlat/rtnl_ifla_info_attrs.h"
 #include "xlat/rtnl_ifla_port_attrs.h"
 #include "xlat/rtnl_ifla_vf_port_attrs.h"
@@ -112,10 +113,9 @@ decode_ifla_bridge_id(struct tcb *const tcp,
        if (len < sizeof(id))
                return false;
        else if (!umove_or_printaddr(tcp, addr, &id)) {
-               tprintf("{prio=[%u, %u], addr=%02x:%02x:%02x:%02x:%02x:%02x}",
-                       id.prio[0], id.prio[1],
-                       id.addr[0], id.addr[1], id.addr[2],
-                       id.addr[3], id.addr[4], id.addr[5]);
+               tprintf("{prio=[%u, %u]", id.prio[0], id.prio[1]);
+               PRINT_FIELD_MAC(", ", id, addr);
+               tprints("}");
        }
 
        return true;
@@ -375,6 +375,22 @@ decode_ifla_xdp(struct tcb *const tcp,
        return true;
 }
 
+static bool
+decode_ifla_event(struct tcb *const tcp,
+                 const kernel_ulong_t addr,
+                 const unsigned int len,
+                 const void *const opaque_data)
+{
+       uint32_t ev;
+
+       if (len < sizeof(ev))
+               return false;
+       else if (!umove_or_printaddr(tcp, addr, &ev))
+               printxval(rtnl_ifla_events, ev, "IFLA_EVENT_???");
+
+       return true;
+}
+
 static const nla_decoder_t ifinfomsg_nla_decoders[] = {
        [IFLA_ADDRESS]          = NULL, /* unimplemented */
        [IFLA_BROADCAST]        = NULL, /* unimplemented */
@@ -419,7 +435,12 @@ static const nla_decoder_t ifinfomsg_nla_decoders[] = {
        [IFLA_GSO_MAX_SIZE]     = decode_nla_u32,
        [IFLA_PAD]              = NULL,
        [IFLA_XDP]              = decode_ifla_xdp,
-       [IFLA_EVENT]            = decode_nla_u32
+       [IFLA_EVENT]            = decode_ifla_event,
+       [IFLA_NEW_NETNSID]      = decode_nla_s32,
+       [IFLA_IF_NETNSID]       = decode_nla_s32,
+       [IFLA_CARRIER_UP_COUNT] = decode_nla_u32,
+       [IFLA_CARRIER_DOWN_COUNT]       = decode_nla_u32,
+       [IFLA_NEW_IFINDEX]      = decode_nla_ifindex,
 };
 
 DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)