Fix missing port # in pcap files

This commit is contained in:
William Robinet 2022-08-04 13:01:36 +02:00
parent 11fee71673
commit 0543025fca

View file

@ -62,14 +62,14 @@ static int create_pcap_logger(proto_obj **objp, struct sockaddr_storage *i_addr,
ABORT(R_NO_MEMORY); ABORT(R_NO_MEMORY);
//src_addr.sin_family = AF_INET; //src_addr.sin_family = AF_INET;
//src_addr.sin_port = htons(i_port);
//src_addr.sin_addr = *i_addr; //src_addr.sin_addr = *i_addr;
memcpy(&src_addr, i_addr, sizeof(struct sockaddr_in)); memcpy(&src_addr, i_addr, sizeof(struct sockaddr_in));
src_addr.sin_port = htons(i_port);
//dst_addr.sin_family = AF_INET; //dst_addr.sin_family = AF_INET;
//dst_addr.sin_port = htons(r_port);
//dst_addr.sin_addr = *r_addr; //dst_addr.sin_addr = *r_addr;
memcpy(&dst_addr, r_addr, sizeof(struct sockaddr_in)); memcpy(&dst_addr, r_addr, sizeof(struct sockaddr_in));
dst_addr.sin_port = htons(r_port);
logpkt_ctx_init(pcap_obj,NULL,0,content_pcap_src_ether, content_pcap_dst_ether, logpkt_ctx_init(pcap_obj,NULL,0,content_pcap_src_ether, content_pcap_dst_ether,
(const struct sockaddr*)&src_addr, sizeof(src_addr), (const struct sockaddr*)&src_addr, sizeof(src_addr),