#3 Fix byte order issue in port number handling

open
nobody
None
5
2009-05-01
2009-05-01
Anonymous
No

Gives incorrect port numbers due to failure to handle network/network byte order issue, patch is as follows:

--- tcpxtract.c.orig 2005-10-05 21:44:39.000000000 -0400
+++ tcpxtract.c 2009-05-01 15:05:49.000000000 -0400
@@ -199,8 +199,8 @@
conn.ip_dst = ip->ip_dst.s_addr;
memcpy(conn.eth_src, ethernet->ether_shost, ETHER_ADDR_LEN);
memcpy(conn.eth_dst, ethernet->ether_dhost, ETHER_ADDR_LEN);
- conn.port_src = tcp->th_sport;
- conn.port_dst = tcp->th_dport;
+ conn.port_src = ntohs(tcp->th_sport);
+ conn.port_dst = ntohs(tcp->th_dport);

if (sessions != NULL) {
session = find_session(&sessions, &conn);

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks