Synchronized with latest picotcp:master.