Skip to content

Commit 6c89dac

Browse files
committed
netfilter: ctnetlink: missing counters and timestamp in nfnetlink_{log,queue}
Add counters and timestamps (if available) to the conntrack object that is represented in nfnetlink_log and _queue messages. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent bd1431d commit 6c89dac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/netfilter/nf_conntrack_netlink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,6 +2669,8 @@ ctnetlink_glue_build_size(const struct nf_conn *ct)
26692669
+ nla_total_size(0) /* CTA_HELP */
26702670
+ nla_total_size(NF_CT_HELPER_NAME_LEN) /* CTA_HELP_NAME */
26712671
+ ctnetlink_secctx_size(ct)
2672+
+ ctnetlink_acct_size(ct)
2673+
+ ctnetlink_timestamp_size(ct)
26722674
#if IS_ENABLED(CONFIG_NF_NAT)
26732675
+ 2 * nla_total_size(0) /* CTA_NAT_SEQ_ADJ_ORIG|REPL */
26742676
+ 6 * nla_total_size(sizeof(u_int32_t)) /* CTA_NAT_SEQ_OFFSET */
@@ -2726,6 +2728,10 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct)
27262728
if (ctnetlink_dump_protoinfo(skb, ct, false) < 0)
27272729
goto nla_put_failure;
27282730

2731+
if (ctnetlink_dump_acct(skb, ct, IPCTNL_MSG_CT_GET) < 0 ||
2732+
ctnetlink_dump_timestamp(skb, ct) < 0)
2733+
goto nla_put_failure;
2734+
27292735
if (ctnetlink_dump_helpinfo(skb, ct) < 0)
27302736
goto nla_put_failure;
27312737

0 commit comments

Comments
 (0)