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

Using host-endian in mode instead of network byte order #8

Open
netrounds-alapaa opened this issue Mar 1, 2016 · 4 comments
Open

Comments

@netrounds-alapaa
Copy link

Row 217 of client.c, the mode needs to be converted to network byte order before sending SetUpResponse to reflector. Verified by testing against Cisco TWAMP, a Cisco 890 router.

@netrounds-alapaa netrounds-alapaa changed the title Using little-endian in mode instead of network byte order Using host-endian in mode instead of network byte order Mar 30, 2016
@zoidberg55
Copy link

Hi @netrounds-alapaa . Can you provide the code you used to correct this? I am trying to run this in my network and router keeps rejecting the sessions because of the byte ordering. Thanks!

@netrounds-alapaa
Copy link
Author

Hi @zoidberg55 try something like this:

resp.Mode = htonl(greet.Modes & authmode);

@netrounds-oskar
Copy link

This is still a thing. Any TWAMP client using this reflector should always close the connection according to the RFC.

The mode field in the greeting is currently 01 00 00 00 but is supposed to be 00 00 00 01.

From the RFC (https://tools.ietf.org/html/rfc4656#section-3.1):

                                            The value of the Modes field
   sent by the server is the bit-wise OR of the mode values that it is
   willing to support during this session.  Thus, the last three bits of
   the Modes 32-bit value are used.  The first 29 bits MUST be zero. 

and

   If the Modes value is zero, the server does not wish to communicate
   with the client and MAY close the connection immediately.  The client
   SHOULD close the connection if it receives a greeting with Modes
   equal to zero. 

@kokakrishna
Copy link

kokakrishna commented May 4, 2018 via email

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

4 participants