diff mbox

[libnftnl] expr: exthdr: Display NFT_EXTHDR_F_PRESENT in debug output

Message ID 20170311132723.7829-1-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Phil Sutter March 11, 2017, 1:27 p.m. UTC
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(-)

Comments

Pablo Neira Ayuso March 13, 2017, 11:15 a.m. UTC | #1
On Sat, Mar 11, 2017 at 02:27:23PM +0100, Phil Sutter wrote:
> This allows to assert it in testsuite also.

Also applied, thanks.
--
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/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