]> granicus.if.org Git - strace/blobdiff - rtnl_route.c
CREDITS.in: use UTF-8 consistently
[strace] / rtnl_route.c
index 7a04a922293764f38574caec752cd5b257692e71..102b8057cf23ae9368667f8fe17ba4e2be331a8a 100644 (file)
 #include "xlat/rtnl_route_attrs.h"
 #include "xlat/rtnl_rta_metrics_attrs.h"
 
+bool
+decode_nla_rt_class(struct tcb *const tcp,
+                   const kernel_ulong_t addr,
+                   const unsigned int len,
+                   const void *const opaque_data)
+{
+       uint32_t num;
+
+       if (len < sizeof(num))
+               return false;
+       if (!umove_or_printaddr(tcp, addr, &num))
+               printxval(routing_table_ids, num, NULL);
+       return true;
+}
+
 static bool
 decode_route_addr(struct tcb *const tcp,
                  const kernel_ulong_t addr,
@@ -207,7 +222,7 @@ static const nla_decoder_t rtmsg_nla_decoders[] = {
        [RTA_CACHEINFO]         = decode_rta_cacheinfo,
        [RTA_SESSION]           = NULL, /* unused */
        [RTA_MP_ALGO]           = decode_nla_u32,
-       [RTA_TABLE]             = decode_nla_u32,
+       [RTA_TABLE]             = decode_nla_rt_class,
        [RTA_MARK]              = decode_nla_u32,
        [RTA_MFC_STATS]         = decode_rta_mfc_stats,
        [RTA_VIA]               = decode_rtvia,