issues
search
F-Stack
/
f-stack
F-Stack is an user space network development kit with high performance based on DPDK, FreeBSD TCP/IP stack and coroutine API.
http://www.f-stack.org
Other
3.87k
stars
899
forks
source link
反向代理连接服务端时获取的端口限制在10000到65535之间问题
#800
Closed
Arnoldream
closed
9 months ago
Arnoldream
commented
9 months ago
[
https://github.com/F-Stack/f-stack/blob/dev/freebsd/netinet/in_pcb.c
-我测试反向代理时发现连接服务端时获取的端口没有限制在10000到65535之间,通过查看代码发现in_pcb_lport_dest函数中lastport给lport赋值时执行了htons,不是很理解,希望能解惑。 ++
lastport; if (
lastport < first ||
lastport > last)
lastport = first; lport = htons(*lastport);
Arnoldream
commented
9 months ago
是转换字节序后进行检查,理解错误