Page MenuHomeFreeBSD

ip_mroute: refactor epoch-based locking

Authored by wma on Jan 25 2022, 9:23 AM.


Remove duplicated epoch_enter and epoch_exit in IP inp/outp routines.
Remove unnecessary macros as well.

Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wma requested review of this revision.Jan 25 2022, 9:23 AM

Why do you still require the epoch to enter X_ip_mrouter_done? Epoch isn't required to write to a pointer that points at data protected by epoch.

Do we still need include <netinet/ip_mroute.h> in ip_input.c and ip_output.c after this change?


There is still a potential race between rip_detach and handling MRT_DONE (both call ip_mrouter_done). AFAIK these functions are not used at the same time so its highly unlikely this ever happen - I've never seen it so far.
I'm planning to further refactor ip_mroute.c to avoid this kind of issues, but not in this commit.

This revision is now accepted and ready to land.Feb 1 2022, 6:54 PM
This revision was automatically updated to reflect the committed changes.