-
Notifications
You must be signed in to change notification settings - Fork 867
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
Added check to prevent applications from connecting to self #377
base: master
Are you sure you want to change the base?
Added check to prevent applications from connecting to self #377
Conversation
CMakeLists.txt
Outdated
@@ -643,6 +642,10 @@ macro(srt_make_application name) | |||
set_target_properties(${name} PROPERTIES COMPILE_FLAGS "${CFLAGS_CXX_STANDARD} ${EXTRA_stransmit}" ${FORCE_RPATH}) | |||
|
|||
target_link_libraries(${name} ${srt_link_library}) | |||
|
|||
if (MICROSOFT) | |||
target_link_libraries(${name} Iphlpapi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this add iphlpapi.dll as dependency for all apps, not just "testing" which the only place where it is currently needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is predicted to be done by all applications that make SRT connections, so this would be simply a complicated conditional slalom, to be withdrawn later anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for complicated slalom, just add a quick and dirty block, maybe a parameter to 'srt_make_application', that will be easy to remove later if and when we decide to add iphlpapi.dll dependancy to all apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be added to EVERY application, as long as explicitly requested. For Linux & Mac it will be always done (needs no extra features from the system). For Windows, it requires extra ENABLE_CONSELF_CHECK_WIN32
flag as it implies linking against extra Iphlpapi.lib
.
Current status: The current solution on Windows uses
|
Current status: A new flag has been added, which allows this prevention to be done in the applications also on Windows, as it requires an extra |
There's a problem when the Rendezvous connection mistakenly specifies a self address. In this case the connection facility gets confused by getting back packets that the agent himself has sent, taking these sent packets as if they came from the peer. This leads to misleading errors that result from interpreting packets that the agent shouldn't have received in the first place.
This fix causes error when
srt_connect
is called with target address that: