Cherry pick network-related Eddy's commits from master to 3.6.x.