Skip to content

RFC conntrack: add interface information to accounting extend

Holger Eitzenberger netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3acct: introduce nf_conn_acctinclude/net/netfilter/nf_conntrack_acct.h include/net/netfilter/nf_conntrack_extend.h net/netfilter/nf_conntrack_acct.c +3 more+38 -240 replies
2/3ctnetlink: account both directions in one stepnet/netfilter/nf_conntrack_netlink.c+26 -260 replies
3/3acct: add input and output interface indexinclude/net/netfilter/nf_conntrack_acct.h include/uapi/linux/netfilter/nfnetlink_conntrack.h net/netfilter/nf_conntrack_core.c +1 more+34 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/3] conntrack: add interface information to accounting extend

Hi,

there are quite some IPFIX collectors (both commercial and not), which rely on the exported accounting data to contain the interface index the packet arrived, as well as the interface index the packet left the box. This is AFAIK not mandated by the RFC, but just a de facto standard set by those vendors.

Those collectors then often don't work if interface data is missing.

I try to solve this by adding the missing interface data to the accounting extend. See following three patches.

First patch encapsulates both directions of the extend data into a newly introduced nf_conn_acct. This could make sense even if not adding interface indices later.

2nd patch coalesces two calls of ctnetlink_dump_counters() into a single call of newly created ctnetlink_dump_acct(), with the intent to add interface info in the following patch. ABI stays the same.

The 3rd patch then adds the interface indices to the accounting extend. I chose to wrap both inside a newly introduced CTA_ACCT attribute in the hope to improve the situation for readers not using this extend. At the cost of adding another 'nlattr' to the output:

<CTA_ACCT>
<CTA_ACCT_INDEV, u32>
<CTA_ACCT_OUTDEV, u32>

Please check the patches, I appreciate your comments.

Thanks.

/Holger