On Wed, Aug 23, 2017 at 08:45:18AM +0800, JingPiao Chen wrote: > * configure.ac (AC_CHECK_TYPES): Check for > rta_mfc_stats and rtvia structures in <linux/rtnetlink.h>. > * nlattr.c (decode_nla_ifindex): New function. > * nlattr.h (decode_nla_ifindex): New prototype. > * rtnl_route.c (decode_route_addr, decode_rta_metrics, > decode_rta_multipath, decode_rta_cacheinfo, > decode_rta_mfc_stats, decode_rtvia, > decode_rta_encap_type): New functions. > (rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays. > (decode_rtmsg): Use rtmsg_nla_decoders. > * xlat/lwtunnel_encap_types.in: New file. > * xlat/route_nexthop_flags.in: Likewise. > * xlat/rtnl_rta_metrics_attrs.in: Likewise. [...] > +static bool > +decode_rtvia(struct tcb *const tcp, > + const kernel_ulong_t addr, > + const unsigned int len, > + const void *const opaque_data) > +{ > +#ifdef HAVE_STRUCT_RTVIA > + struct rtvia via; > + > + if (len < sizeof(via)) > + return false; > + else if (!umove_or_printaddr(tcp, addr, &via)) { > + PRINT_FIELD_XVAL("{", via, rtvia_family, addrfams, "AF_???"); > + > + if (len > sizeof(via)) { > + tprints(", rtvia_addr="); > + printstr_ex(tcp, addr + sizeof(via), > + len - sizeof(via), QUOTE_FORCE_HEX);
Looks like decode_inet_addr would be more appropriate here than printstr_ex. We might end up with renaming decode_inet_addr to something more generic and extending it to handle AF_PACKET in addition to AF_INET and AF_INET6. -- ldv
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel