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

PPID (maybe other) fields in SndRcvInfo not converted correctly on SCTPWrite() #66

Open
vingarzan opened this issue Aug 8, 2024 · 0 comments

Comments

@vingarzan
Copy link

vingarzan commented Aug 8, 2024

Hey folks,

I have observed that if I set the PPID in SndRcvInfo on SCTPConn.SCTPWrite() to some simple value like 46 (a.i. Diameter according to IANA) from an x86 (little-endian), the on-the-wire PPID (supposed to be BigEndian) has the bytes reversed. So before using, I'd have to do something like (or set it to 0x2e000000, you get the gist):

b := make([]byte, 4)
binary.NativeEndian.PutUint32(b, 46)
sndRcvInfo.ppid = binary.BigEndian.Uint32(b)

I saw that toBuf() uses binary to write the info data. But could it be that instead of using the nativeEndian it should use always the network-byte-order (aka binary.BigEndian), as things should be on the wire? (or maybe toBuf()'s use there is wrong?)

Cheers,
-Dragos

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