netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libnetfilter_cthelper] examples: kill the "invalid argument" error in nftc-helper-add
@ 2017-03-22 13:00 Liping Zhang
  2017-03-22 13:09 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Liping Zhang @ 2017-03-22 13:00 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Liping Zhang

From: Liping Zhang <zlpnobody@gmail.com>

NFCTH_PRIV_DATA_LEN is a must attribute required by the kernel when
creating the cthelper, add it now. Otherwise -EINVAL will be returned.

Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
---
 examples/nfct-helper-add.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/nfct-helper-add.c b/examples/nfct-helper-add.c
index cb7291e..79e0963 100644
--- a/examples/nfct-helper-add.c
+++ b/examples/nfct-helper-add.c
@@ -31,6 +31,7 @@ int main(int argc, char *argv[])
 	nfct_helper_attr_set_u32(nfct_helper, NFCTH_ATTR_QUEUE_NUM, atoi(argv[2]));
 	nfct_helper_attr_set_u16(nfct_helper, NFCTH_ATTR_PROTO_L3NUM, AF_INET);
 	nfct_helper_attr_set_u8(nfct_helper, NFCTH_ATTR_PROTO_L4NUM, IPPROTO_TCP);
+	nfct_helper_attr_set_u32(nfct_helper, NFCTH_ATTR_PRIV_DATA_LEN, 0);
 
 	/* Will be freed by nfct_helper_free. */
 	p = nfct_helper_policy_alloc();
-- 
2.5.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-22 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22 13:00 [PATCH libnetfilter_cthelper] examples: kill the "invalid argument" error in nftc-helper-add Liping Zhang
2017-03-22 13:09 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).