From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [libnftnl PATCH] expr: exthdr: Display NFT_EXTHDR_F_PRESENT in debug output
Date: Sat, 11 Mar 2017 14:27:23 +0100 [thread overview]
Message-ID: <20170311132723.7829-1-phil@nwl.cc> (raw)
This allows to assert it in testsuite also.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
src/expr/exthdr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
index 9ed4ae1725ac1..d4f166525dc9e 100644
--- a/src/expr/exthdr.c
+++ b/src/expr/exthdr.c
@@ -301,9 +301,11 @@ static int nftnl_expr_exthdr_snprintf_default(char *buf, size_t len,
const struct nftnl_expr *e)
{
struct nftnl_expr_exthdr *exthdr = nftnl_expr_data(e);
- return snprintf(buf, len, "load%s %ub @ %u + %u => reg %u ",
+ return snprintf(buf, len, "load%s %ub @ %u + %u%s => reg %u ",
op2str(exthdr->op), exthdr->len, exthdr->type,
- exthdr->offset, exthdr->dreg);
+ exthdr->offset,
+ exthdr->flags & NFT_EXTHDR_F_PRESENT ? " present" : "",
+ exthdr->dreg);
}
static int
--
2.11.0
next reply other threads:[~2017-03-11 13:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-11 13:27 Phil Sutter [this message]
2017-03-13 11:15 ` [libnftnl PATCH] expr: exthdr: Display NFT_EXTHDR_F_PRESENT in debug output Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170311132723.7829-1-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).