Quoting Masatake YAMATO (2016-05-15 06:45:12) > On Sun, 15 May 2016 02:27:36 +0300, "Dmitry V. Levin" <l...@altlinux.org> > wrote: > >> + if (netlink_proto) { > >> + if (asprintf(&details, "%s:[%s]", proto_name, > >> + netlink_proto) < 0) > > > > I've tried this with "ip l" command, and it printed > > <NETLINK:[NETLINK_ROUTE]>, which looks redundant. > > > > Wouldn't it be more useful to print just netlink_proto but also add more > > netlink specific information, e.g. <NETLINK_ROUTE:[ndiag_portid]>? > > How about <NETLINK:[ROUTE]> ? > > `NETLINK_' prefix comes from netlink_protocols.h. > As far as seeing the contents of netlink_protocols array, > it seems that all entries have the same prefix. > The prefix can be trimmed before build a string which will be cached: > > + if (netlink_proto) { > ++ if (has_prefix (netlink_proto, "NETLINK_")) > ++ netlink_proto += netlink_proto + strlen ("NETLINK_"); > + if (asprintf(&details, "%s:[%s]", proto_name, > + netlink_proto) < 0) > + return -1; > + } else {
I agree, I think that <NETLINK:[ROUTE:ndiag_portid]> is clearer than <NETLINK_ROUTE:[ndiag_portid]>. Cheers, -- Fabien Siron ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel