On Sat, Aug 12, 2017 at 11:33:51PM +0800, JingPiao Chen wrote: > On Sat, Aug 12, 2017 at 03:05:15AM +0300, Dmitry V. Levin wrote: > > On Thu, Aug 10, 2017 at 09:04:52AM +0800, JingPiao Chen wrote: > > > * rtnl_addr.c: New file. > > > * Makefile.am (strace_SOURCES): Add it. > > > * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h. > > > * netlink_route.h (decode_ifaddrmsg): New prototype. > > > * netlink_route.c (route_decoders): Add RTM_DELADDR, > > > RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST add RTM_NEWADDR. > > > * xlat/ifaddrflags.in: New file. > > [...] > > > +DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg) > > > +{ > > > + struct ifaddrmsg ifaddr = { .ifa_family = family }; > > > + const size_t offset = sizeof(ifaddr.ifa_family); > > > + > > > + PRINT_FIELD_XVAL("{", ifaddr, ifa_family, addrfams, "AF_???"); > > > + > > > + tprints(", "); > > > + if (len >= sizeof(ifaddr)) { > > > + if (!umoven_or_printaddr(tcp, addr + offset, > > > + sizeof(ifaddr) - offset, > > > + (void *) &ifaddr + offset)) { > > > + PRINT_FIELD_U("", ifaddr, ifa_prefixlen); > > > + PRINT_FIELD_FLAGS(", ", ifaddr, ifa_flags, > > > + ifaddrflags, "IFA_F_???"); > > > + PRINT_FIELD_U(", ", ifaddr, ifa_scope); > > > > When ifaddr.ifa_flags contains one of RT_SCOPE_* constants defined > > in linux/rtnetlink.h, it would be better if this constant was printed > > in its symbolic form. > > You means: > > route_scope = RT_SCOPE_*. > printflags_ex(ifaddr.ifa_flags, NULL, ifaddrflags, route_scope, NULL); > > I do not understand why ifaddr.ifa_flags contain RT_SCOPE_* constants?
Of course it's ifa_scope, not ifa_flags: PRINT_FIELD_XVAL(", ", ifaddr, ifa_scope, NULL); -- 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