HomeFreeBSD

pf: Access r->rpool.cur->kif under mutex protection

Description

pf: Access r->rpool.cur->kif under mutex protection

pf_route() sends traffic to a specified next hop over a specific
interface. The next hop is obtained in pf_map_addr() but the interface
is obtained directly via r->rpool.cur->kif` outside of the lock held in
pf_map_addr() in multiple places around pf. The chosen interface is not
stored in source node.

Move the interface selection into pf_map_addr(), have the function
return it together with the chosen IP address and ensure its stored
in struct pf_ksrc_node, store it in the source node and use the stored
value when needed.

Sponsored by: InnoGames GmbH
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D41570

Details

Provenance
vegeta_tuxpowered.netAuthored on Aug 24 2023, 11:05 AM
kpCommitted on Aug 24 2023, 11:05 AM
Differential Revision
D41570: pf: Access r->rpool.cur->kif under mutex protection
Parents
rGd9fee1d02178: cam/scsi_da: Bump deprecation one release.
Branches
Unknown
Tags
Unknown