pf: Fix missing connection rate for DIOCGETSRCNODES

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.

Reviewed by:		kp
Approved by:		kp (mentor)
MFC after:		2 weeks
Sponsored by:		InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D47679
This commit is contained in:
Kajetan Staszkiewicz 2024-11-21 15:23:42 +01:00
parent 976ab1425d
commit e8eb3096d8

View File

@ -1570,6 +1570,7 @@ pf_src_node_copy(const struct pf_ksrc_node *in, struct pf_src_node *out)
out->expire = 0;
/* Adjust the connection rate estimate. */
out->conn_rate = in->conn_rate;
diff = secs - in->conn_rate.last;
if (diff >= in->conn_rate.seconds)
out->conn_rate.count = 0;