Skip to contentSkip to conversation

netfilter: nf_tables: Add extra bits for object handles

PATCH In review Harsha Sharma 2 participants 2 messages Jan 23, 2018 – Jan 24, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nf_tables: Add extra bits for object handles

Add extra bits for table, chain, sets and object handle.

---
 net/netfilter/nf_tables_trace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/netfilter/nf_tables_trace.c +5 -1
index e1dc527a493b..f804c3924d32 100644
@@ -212,7 +212,11 @@ void nft_trace_notify(struct nft_traceinfo *info)
 		nla_total_size(sizeof(__be16)) +	/* oiftype */
 		nla_total_size(sizeof(u32)) +		/* mark */
 		nla_total_size(sizeof(u32)) +		/* nfproto */
-		nla_total_size(sizeof(u32));		/* policy */
+		nla_total_size(sizeof(u32)); +		/* policy */
+		nla_total_size_64bit(sizeof(__be64)) +	/* table handle */
+		nla_total_size_64bit(sizeof(__be64)) +	/* chain handle */
+		nla_total_size_64bit(sizeof(__be64)) +	/* set handle */
+		nla_total_size_64bit(sizeof(__be64))	/* object handle */
 
 	if (nft_trace_have_verdict_chain(info))
 		size += nla_total_size(strlen(info->verdict->chain->name)); /* jump target */
Signature · 1 line
2.11.0
#1 lore raw
Quoted 12 lines · Harsha Sharma

Add extra bits for table, chain, sets and object handle.

---
 net/netfilter/nf_tables_trace.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
net/netfilter/nf_tables_trace.c +0 -0
index e1dc527a493b..f804c3924d32 100644

net/netfilter/nf_tables_trace.c void nft_trace_notify(struct nft_traceinfo *info) · line 219

Quoted 9 lines
net/netfilter/nf_tables_trace.c +5 -1
@@ -212,7 +212,11 @@ void nft_trace_notify(struct nft_traceinfo *info)
 		nla_total_size(sizeof(__be16)) +	/* oiftype */
 		nla_total_size(sizeof(u32)) +		/* mark */
 		nla_total_size(sizeof(u32)) +		/* nfproto */
-		nla_total_size(sizeof(u32));		/* policy */
+		nla_total_size(sizeof(u32)); +		/* policy */
+		nla_total_size_64bit(sizeof(__be64)) +	/* table handle */
+		nla_total_size_64bit(sizeof(__be64)) +	/* chain handle */
+		nla_total_size_64bit(sizeof(__be64)) +	/* set handle */
+		nla_total_size_64bit(sizeof(__be64))	/* object handle */

I think just two of this should be fine. Is nla_total_size_64bit() accounting for padding too?

I would like to see the userspace patches in place too, to test this.

Thanks!