* rtnl_addrlabel.c (decode_ifal_address): New function. (ifaddrlblmsg_nla_decoders): New array. (decode_ifaddrlblmsg): Use it. --- rtnl_addrlabel.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/rtnl_addrlabel.c b/rtnl_addrlabel.c index 53cfb2c..7fc4875 100644 --- a/rtnl_addrlabel.c +++ b/rtnl_addrlabel.c @@ -40,6 +40,24 @@ # include "xlat/rtnl_addrlabel_attrs.h" +static bool +decode_ifal_address(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct ifaddrlblmsg *const ifal = opaque_data; + + decode_inet_addr(tcp, addr, len, ifal->ifal_family, NULL); + + return true; +} + +static const nla_decoder_t ifaddrlblmsg_nla_decoders[] = { + [IFAL_ADDRESS] = decode_ifal_address, + [IFAL_LABEL] = decode_nla_u32 +}; + DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg) { struct ifaddrlblmsg ifal = { .ifal_family = family }; @@ -67,7 +85,9 @@ DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg) if (decode_nla && len > offset) { tprints(", "); decode_nlattr(tcp, addr + offset, len - offset, - rtnl_addrlabel_attrs, "IFAL_???", NULL, 0, NULL); + rtnl_addrlabel_attrs, "IFAL_???", + ifaddrlblmsg_nla_decoders, + ARRAY_SIZE(ifaddrlblmsg_nla_decoders), &ifal); } } -- 2.7.4 ------------------------------------------------------------------------------ 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