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

[core] Fix peer filter config being rejected because of endianness #2708

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

yomnes0
Copy link
Collaborator

@yomnes0 yomnes0 commented Apr 3, 2023

Partial fix for bug #2697. Peer filter config should now correctly be interpreted even on big endian systems

@codecov-commenter

This comment was marked as off-topic.

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Apr 3, 2023
@maxsharabayko maxsharabayko added this to the v1.5.2 milestone Apr 3, 2023
@maxsharabayko
Copy link
Collaborator

Some weird failure on Travis, Linux runner BUILD_TYPE=Debug BUILD_OPTS='-DENABLE_LOGGING=OFF -DUSE_ENCLIB=mbedtls -DENABLE_MONOTONIC_CLOCK=ON -DENABLE_BONDING=ON -DCMAKE_CXX_FLAGS="-Werror"'.
Restarting.

[ RUN      ] ReuseAddr.Wildcard
[T/S] serverSocket: creating listener socket
[T/S] Listener/binder sock @568050255 added to server_pollid
[T/S] Bind @568050255 to: 0.0.0.0:5000 (IPv4)
[T/S] ... result 0 (expected to succeed)
[T/S] serverSocket: creating binder socket
[T/S] Listener/binder sock @568050254 added to server_pollid
[T/S] Bind @568050254 to: 10.30.1.59:5000 (IPv4)
[T/S] ... result -1 (expected to fail)
[T/S] Binding should fail: Operation not supported: Another socket is bound to that port and is not reusable for requested settings
[T/S] Wait 10s for acceptance on @568050255 ...
[T/C] Creating client socket
[T/C] Connecting to: 127.0.0.1:5000 (IPv4)
[T/S] Accepted from: 127.0.0.1:39791
[T/S] Wait for data reception...
[T/C] Waiting for connection readiness...
[T/C] Client exit
[T/S] closing sockets: ACP:@568050252 LSN:@568050255 CLR:@568050253 ...
/home/travis/build/Haivision/srt/test/test_reuseaddr.cpp:414: Failure
Expected: (srt_close(g_client_sock)) != (SRT_ERROR), actual: -1 vs -1
[T/S] waiting for cleanup of @568050255 up to 10s
[T/S] @568050255 dissolved after 1.009s
[  FAILED  ] ReuseAddr.Wildcard (1132 ms)

Comment on lines 2837 to +2839
memcpy((target), begin + 1, bytelen);
// Un-swap on big endian machines
ItoHLA((uint32_t *)target, (uint32_t *)target, blocklen);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ItoHLA just replace the above memcpy to not copy twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to work as well, this can be done for connector's requested SID and congestion-control type as well. I'll include those changes in my next PR

@matoro
Copy link
Contributor

matoro commented Apr 4, 2023

This indeed looks good on BE:

99% tests passed, 3 tests failed out of 217

Total Test time (real) =  39.67 sec 

The following tests did not run:
        208 - CTimer.SleeptoAccuracy (Disabled)

The following tests FAILED:
         24 - CIPAddress.IPv6_pton (Failed)
        105 - TestIPv6.v6_calls_v4 (Failed)
        200 - SyncEvent.WaitForTwoNotifyOne (Failed)

@maxsharabayko maxsharabayko merged commit a991767 into Haivision:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants