aboutsummaryrefslogtreecommitdiffstats
path: root/src/expect/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expect/api.c')
-rw-r--r--src/expect/api.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/expect/api.c b/src/expect/api.c
index a1dbbff..4521f16 100644
--- a/src/expect/api.c
+++ b/src/expect/api.c
@@ -665,20 +665,20 @@ int nfexp_parse_expect(enum nf_conntrack_msg_type type,
* On error, -1 is returned and errno is explicitely set. On success, 0
* is returned.
*/
+#define QUERY_SIZE 4096
int nfexp_query(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
union {
- char buffer[size];
+ char buffer[QUERY_SIZE];
struct nfnlhdr req;
} u;
assert(h != NULL);
assert(data != NULL);
- if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1)
+ if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, QUERY_SIZE) == -1)
return -1;
return nfnl_query(h->nfnlh, &u.req.nlh);
@@ -701,16 +701,15 @@ int nfexp_send(struct nfct_handle *h,
const enum nf_conntrack_query qt,
const void *data)
{
- size_t size = 4096; /* enough for now */
union {
- char buffer[size];
+ char buffer[QUERY_SIZE];
struct nfnlhdr req;
} u;
assert(h != NULL);
assert(data != NULL);
- if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, size) == -1)
+ if (__build_query_exp(h->nfnlssh_exp, qt, data, &u.req, QUERY_SIZE) == -1)
return -1;
return nfnl_send(h->nfnlh, &u.req.nlh);