summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expect/snprintf_default.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/expect/snprintf_default.c b/src/expect/snprintf_default.c
index a20a3ad..51ffb30 100644
--- a/src/expect/snprintf_default.c
+++ b/src/expect/snprintf_default.c
@@ -7,12 +7,21 @@
#include "internal/internal.h"
+static int
+__snprintf_expect_timeout(char *buf, unsigned int len,
+ const struct nf_expect *exp)
+{
+ if (test_bit(ATTR_EXP_TIMEOUT, exp->set))
+ return snprintf(buf, len, "%u ", exp->timeout);
+
+ return 0;
+}
+
static int __snprintf_expect_proto(char *buf,
unsigned int len,
const struct nf_expect *exp)
{
- return(snprintf(buf, len, "%u proto=%d ",
- exp->timeout,
+ return(snprintf(buf, len, "proto=%d ",
exp->expected.tuple[__DIR_ORIG].protonum));
}
@@ -41,6 +50,9 @@ int __snprintf_expect_default(char *buf,
BUFFER_SIZE(ret, size, len, offset);
+ ret = __snprintf_expect_timeout(buf+offset, len, exp);
+ BUFFER_SIZE(ret, size, len, offset);
+
ret = __snprintf_expect_proto(buf+offset, len, exp);
BUFFER_SIZE(ret, size, len, offset);