问题
I like to know the source port of packet in tcphdr can be assigned to destination port of ip like this
source_ip_tcph->source= dest_ip_tcph->dest;
source_ip_tcph->dest = dest_ip_tcph->source;
above are source and destination (pointer to memory) of tcphdr type
I am trying to create a server everytime I respond to client from server the destination port is different. I assigned it like above
Edit Above I am using raw sockets. trying to make raw socket based tcp implementation as a server
来源:https://stackoverflow.com/questions/65378401/how-to-assign-incoming-packets-source-port-to-outgoing-packet-destination-port