2017-04-25 78 views

回答

0

tcp_recvmsg()中,struct tcp_sock对象来自参数struct sock sk。您可以执行inet_sk(sk)->inet_sport以获取TCP数据包的目标端口inet_sk(sk)->inet_dport应该得到数据包的源端口。