diff options
Diffstat (limited to 'proto_nlmsg.c')
-rw-r--r-- | proto_nlmsg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/proto_nlmsg.c b/proto_nlmsg.c index 1dde5e1..76253ca 100644 --- a/proto_nlmsg.c +++ b/proto_nlmsg.c @@ -750,15 +750,15 @@ static void nlmsg_print(uint16_t family, struct nlmsghdr *hdr) static void nlmsg(struct pkt_buff *pkt) { - struct nlmsghdr *hdr = (struct nlmsghdr *) pkt_pull(pkt, sizeof(*hdr)); + struct nlmsghdr *hdr = (struct nlmsghdr *) pkt_pull(pkt, NLMSG_HDRLEN); while (hdr) { nlmsg_print(ntohs(pkt->sll->sll_protocol), hdr); - if (!pkt_pull(pkt, NLMSG_PAYLOAD(hdr, 0))) + if (!pkt_pull(pkt, NLMSG_ALIGN(hdr->nlmsg_len) - NLMSG_HDRLEN)) break; - hdr = (struct nlmsghdr *) pkt_pull(pkt, sizeof(*hdr)); + hdr = (struct nlmsghdr *) pkt_pull(pkt, NLMSG_HDRLEN); if (hdr && hdr->nlmsg_type != NLMSG_DONE && (hdr->nlmsg_flags & NLM_F_MULTI)) tprintf("\n"); @@ -767,7 +767,7 @@ static void nlmsg(struct pkt_buff *pkt) static void nlmsg_less(struct pkt_buff *pkt) { - struct nlmsghdr *hdr = (struct nlmsghdr *) pkt_pull(pkt, sizeof(*hdr)); + struct nlmsghdr *hdr = (struct nlmsghdr *) pkt_pull(pkt, NLMSG_HDRLEN); uint16_t family = ntohs(pkt->sll->sll_protocol); char type[32]; |