- [[https://github.com/F-Stack/f-stack/blob/dev/freebsd/netinet/in_pcb.c](url) -我测试反向代理时发现连接服务端时获取的端口没有限制在10000到65535之间,通过查看代码发现in_pcb_lport_dest函数中lastport给lport赋值时执行了htons,不是很理解,希望能解惑。 ++*lastport; if (*lastport < first || *lastport > last) *lastport = first; lport = htons(*lastport);