Skip to content

utils: nfulnl_test: Test nflog_get_packet_hw

Duncan Roe netfilter-devel 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2utils: nfulnl_test: Agree with man pagesutils/nfulnl_test.c+7 -71 reply
2/2utils: nfulnl_test: Add rather extensive test of nflog_get_packet_hw()utils/nfulnl_test.c+25 -01 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH libnetfilter_log 0/2] utils: nfulnl_test: Test nflog_get_packet_hw

Hi Pablo,

This patchset extends utils/nfulnl_test.c to fully exercise nflog_get_packet_hw(). I made these changes while researching how the doxygen for nflog_get_packet_hw should read.

I was rather surprised to find the hw_addrlen field in struct nfulnl_msg_packet_hw is in Network Byte Order, seeing as how it doesn't come off the wire.

Is this a bug? - it's been that way for at least 5 years (Linux 4.4.14).

I'll document on the basis this is correct behaviour for now.

Cheers ... Duncan.

--------------
Sample output:

Quoted 12 lines

17:30:51# /home/dunc/tests/netfilter/nfulnl_test/nfulnl_test unbinding existing nf_log handler for AF_INET (if any)
binding nfnetlink_log to AF_INET
binding this socket to group 0
binding this socket to group 100
setting copy_packet mode
registering callback for group 0
going into main loop
pkt received (len=184)
hw_addrlen = 6 (after htons)
HW addr: 00:00:00:00:00:00
hw_protocol=0x86dd hook=1 mark=0 indev=1 prefix="Hi there Tiger" payload_len=52

Quoted 8 lines

pkt received (len=136)
No struct nfulnl_msg_packet_hw returned
hw_protocol=0x86dd hook=3 mark=0 outdev=2 prefix="What's new Pussycat?" payload_len=52 pkt received (len=196)
hw_addrlen = 6 (after htons)
HW addr: 18:60:24:bb:02:d6
hw_protocol=0x86dd hook=1 mark=0 indev=2 prefix="Hello World" payload_len=52 ^C

"Hi there Tiger" - locally generated UDP6 for interface lo
"What's new Pussycat?" - locally generated UDP6 for interface eth1
"Hello World" - remotely generated UDP6 on interface eth1

Duncan Roe (2):
utils: nfulnl_test: Agree with man pages
utils: nfulnl_test: Add rather extensive test of nflog_get_packet_hw()

 utils/nfulnl_test.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.5