Networking cleanup

This is a PR just to get linux testing. no need to review for now.
Couldn't this whole thing be a `memcpy`?