HomeFreeBSD

ifnet_byindex() actually requires network epoch

Description

ifnet_byindex() actually requires network epoch

Sweep over potentially unsafe calls to ifnet_byindex() and wrap them
in epoch. Most of the code touched remains unsafe, as the returned
pointer is being used after epoch exit. Mark that with a comment.

Validate the index argument inside the function, reducing argument
validation requirement from the callers and making V_if_index
private to if.c.

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D33263

Details

Provenance
glebiusAuthored on Dec 4 2021, 5:49 PM
Reviewer
melifaro
Differential Revision
D33263: ifnet_byindex() actually requires network epoch
Parents
rG7b40b00fad16: ifnet: merge ifindex_alloc(), ifnet_setbyindex(), if_grow() and call magic
Branches
Unknown
Tags
Unknown