diff mbox

libmnl [PATCH 3/5] examples: use mnl_nlmsg_get_payload()

Message ID CAGCkEt0U7wEmzWWK+TiqDjaEjcMEA1VyYQyCFoqUfYy20u4rfg@mail.gmail.com
State Superseded
Headers show

Commit Message

Ken-ichirou MATSUZAWA Dec. 5, 2013, 10:16 a.m. UTC
From: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
Date: Mon, 25 Nov 2013 15:36:28 +0900
Subject: [PATCH 3/5] examples: use mnl_nlmsg_get_payload()

not increment (nlmsghdr) pointer
---
 examples/netfilter/nfct-create-batch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/examples/netfilter/nfct-create-batch.c
b/examples/netfilter/nfct-create-batch.c
index 40cd2f6..a232991 100644
--- a/examples/netfilter/nfct-create-batch.c
+++ b/examples/netfilter/nfct-create-batch.c
@@ -67,7 +67,7 @@  static void put_msg(char *buf, uint16_t i, int seq)

 static int cb_err(const struct nlmsghdr *nlh, void *data)
 {
-       struct nlmsgerr *err = (void *)(nlh + 1);
+       struct nlmsgerr *err = (void *)mnl_nlmsg_get_payload(nlh);
        if (err->error != 0)
                printf("message with seq %u has failed: %s\n",
                        nlh->nlmsg_seq, strerror(-err->error));