HomeFreeBSD

jail: network epoch protection for IP address lists

Description

jail: network epoch protection for IP address lists

Now struct prison has two pointers (IPv4 and IPv6) of struct
prison_ip type. Each points into epoch context, address count
and variable size array of addresses. These structures are
freed with network epoch deferred free and are not edited in
place, instead a new structure is allocated and set.

While here, the change also generalizes a lot (but not enough)
of IPv4 and IPv6 processing. E.g. address family agnostic helpers
for kern_jail_set() are provided, that reduce v4-v6 copy-paste.

The fast-path prison_check_ip[46]_locked() is also generalized
into prison_ip_check() that can be executed with network epoch
protection only.

Reviewed by: jamie
Differential revision: https://reviews.freebsd.org/D33339

Details

Provenance
glebiusAuthored on Dec 26 2021, 6:45 PM
Reviewer
jamie
Differential Revision
D33339: jail: network epoch protection for IP address lists
Parents
rG9df53d07e6bc: clk: add call for nodes to get the programmed/decided frequency passed back
Branches
Unknown
Tags
Unknown