hepipe
hepipe copied to clipboard
payload ports need htons (revert as it was in 2016)
actually htons is needed for ports
this one revert commit 4e0404052784c673db062285d956b167891861cc
diff --git a/hepipe.c b/hepipe.c
index 94b7aae..9eddc13 100644
--- a/hepipe.c
+++ b/hepipe.c
@@ -592,13 +592,13 @@ int send_hepv3 (rc_info_t *rcinfo, unsigned char *data, unsigned int len) {
/* SRC PORT */
hg->src_port.chunk.vendor_id = htons(0x0000);
hg->src_port.chunk.type_id = htons(0x0007);
- hg->src_port.data = rcinfo->src_port;
+ hg->src_port.data = htons(rcinfo->src_port);
hg->src_port.chunk.length = htons(sizeof(hg->src_port));
/* DST PORT */
hg->dst_port.chunk.vendor_id = htons(0x0000);
hg->dst_port.chunk.type_id = htons(0x0008);
- hg->dst_port.data = rcinfo->dst_port;
+ hg->dst_port.data = htons(rcinfo->dst_port);
hg->dst_port.chunk.length = htons(sizeof(hg->dst_port));