All of lore.kernel.org
 help / color / mirror / Atom feed
* How to send nf trace notifications to userspace?
@ 2015-11-06 23:29 Florian Westphal
  2015-11-07 16:38 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Westphal @ 2015-11-06 23:29 UTC (permalink / raw)
  To: netfilter-devel

$subject says most of it.

I started to resurrect the 'nft trace' patch set from

https://patchwork.ozlabs.org/patch/444772/

It works ok with couple of changes to nf_tables_core and nfnetlink
to propagate trace type (return, policy, ...) and the handle of the
rule currently processed.  Also saves us from the 'rule counting'
that we're currently doing in kernel.

$ src/nft trace
SRC=192.168.7.1 DST=192.168.7.10 LEN=88 TTL=64 ID=39366 PROTO=6 SPT=47028 DPT=22 raw prerouting (# handle 6)
        ip protocol tcp limit rate 1/second nftrace set 1
RETURN raw prerouting
ACCEPT raw prerouting
filter input (# handle 7)
        tcp dport ssh jump foo
filter foo (# handle 5)
        ip daddr 192.168.7.10
filter foo (# handle 6)
        counter packets 912 bytes 63619
RETURN filter foo
filter input (# handle 8)
        ip protocol tcp ip daddr 192.168.7.10
filter input (# handle 9)
        tcp dport ssh accept

So basic functionality works on current nftables head.

However, the code uses nfnetlink_log.  It appears that its
unicast only, i.e. its not possible to run another 'nft trace' in parallel
and also clashes with ulogd or other running logger.

Thats a non-starter.

So I'm inclined to toss the nfnetlink_log based changes and
instead (re-)use the infrastructure that we have for chain, rule, ... notifications.

That would mean i'd also just plug the tracing notifications decoding into nft monitor.

Is that ok?
Any better ideas?

Do you think its useful to also dump skb data (i.e. in/outdev,
packet payload, etc?)

Thanks,
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-17 11:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 23:29 How to send nf trace notifications to userspace? Florian Westphal
2015-11-07 16:38 ` Pablo Neira Ayuso
2015-11-07 20:49   ` Florian Westphal
2015-11-09 13:36     ` Patrick McHardy
2015-11-12 15:46       ` [PATCH RFC] netfilter: nf_tables: extend tracing infrastructure Florian Westphal
2015-11-14 18:50         ` Patrick McHardy
2015-11-16 21:56         ` Pablo Neira Ayuso
2015-11-17  0:03           ` Florian Westphal
2015-11-17 10:40             ` Pablo Neira Ayuso
2015-11-17 11:04               ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.