]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: split IpcSetOperation into parts
authorJosh Bleecher Snyder <josh@tailscale.com>
Fri, 15 Jan 2021 22:32:34 +0000 (14:32 -0800)
committerJosh Bleecher Snyder <josh@tailscale.com>
Mon, 25 Jan 2021 17:09:24 +0000 (09:09 -0800)
commit6252de0db9331cbc20074e9d40165266b5816148
treef1d46cda4d0ae0ba07a29962e556f61fc2957423
parenta029b942ae25be8ea31a4945198617c76c31abcd
device: split IpcSetOperation into parts

The goal of this change is to make the structure
of IpcSetOperation easier to follow.

IpcSetOperation contains a small state machine:
It starts by configuring the device,
then shifts to configuring one peer at a time.

Having the code all in one giant method obscured that structure.
Split out the parts into helper functions and encapsulate the peer state.

This makes the overall structure more apparent.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
device/uapi.go