const struct xlat *xlat = netlink_types;
const char *dflt = "NLMSG_???";
- if (family < ARRAY_SIZE(nlmsg_types)) {
+ if (type != NLMSG_DONE && family < ARRAY_SIZE(nlmsg_types)) {
if (nlmsg_types[family].decoder)
decoder = nlmsg_types[family].decoder;
if (nlmsg_types[family].xlat)
{
const struct xlat *table = NULL;
+ if (type == NLMSG_DONE)
+ goto end;
+
switch (family) {
case NETLINK_SOCK_DIAG:
table = netlink_get_flags;
break;
}
+end:
printflags_ex(flags, "NLM_F_???", netlink_flags, table, NULL);
}
tprintf("{len=%u, type=", nlmsghdr->nlmsg_len);
- const int hdr_family = (nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE)
+ const int hdr_family = (nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE
+ && nlmsghdr->nlmsg_type != NLMSG_DONE)
? NL_FAMILY_DEFAULT
: (family != NL_FAMILY_DEFAULT
? family : get_fd_nl_family(tcp, fd));
{
uint8_t family;
+ if (nlmsghdr->nlmsg_type == NLMSG_DONE)
+ return false;
+
if (!umove_or_printaddr(tcp, addr, &family)) {
if (family < ARRAY_SIZE(diag_decoders)
&& len > sizeof(family)) {