Page MenuHomeFreeBSD

pf: Fix timestamps and connection rate in source node export to userspace
ClosedPublic

Authored by vegeta_tuxpowered.net on Nov 19 2024, 9:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 9, 9:32 AM
Unknown Object (File)
Mon, Jan 6, 8:48 AM
Unknown Object (File)
Sun, Jan 5, 10:16 AM
Unknown Object (File)
Sun, Jan 5, 8:34 AM
Unknown Object (File)
Thu, Jan 2, 11:23 AM
Unknown Object (File)
Thu, Jan 2, 2:51 AM
Unknown Object (File)
Wed, Dec 25, 12:50 PM
Unknown Object (File)
Dec 7 2024, 10:13 AM

Details

Summary

The function pf_src_node_copy() copies struct pf_ksrc_node to its ioctl
counterpart. It was missing copying of the conn_rate field, even though
the code for adjusting the output for pfctl was in place.

Add copying of conn_rate.

Sponsored by: InnoGames GmbH

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Good catch. Given that it also needs to be fixed on stable/14 you should add an 'MFC after' tag to the commit message.

MFC after tags are not strictly required before something can be merged back, but it's a good habit. It communicates this to users, and it will also mean you get an automatic reminder e-mail when the time comes to do the merge. It'll also show up on https://mfc.freebsd.org.
The MFC period should be a minimum of 3 days (See rule 6 on https://docs.freebsd.org/en/articles/committers-guide/#rules), but I typically default to one or two weeks.

It might be nice to have a test case for this too, but that's not an absolute requirement for this. We can always add one later.

Please send me the git format-patch for this (with the MFC after and reviewd/approved by tags).

This revision is now accepted and ready to land.Nov 20 2024, 8:59 AM

More a note to self: looking at structure pf_src_node, the only other field we don't set is *kif, but given that it's a pointer that's not really something we can do in the ioctl. I'll make a note of it to revisit this once the netlink migration is complete. We ought to be able to return the interface name then.