Page MenuHomeFreeBSD

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

Authored by vegeta_tuxpowered.net on Tue, Nov 19, 9:54 PM.

Details

Reviewers
kp
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 Skipped
Unit
Tests Skipped

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.Wed, Nov 20, 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.