Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payload ports need htons (revert as it was in 2016) #4

Open
gmaruzz opened this issue Dec 30, 2023 · 0 comments
Open

payload ports need htons (revert as it was in 2016) #4

gmaruzz opened this issue Dec 30, 2023 · 0 comments

Comments

@gmaruzz
Copy link

gmaruzz commented Dec 30, 2023

actually htons is needed for ports

this one revert commit 4e04040

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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant