Skip to content

Commit

Permalink
[core] srt_rendezvous(..): removed local-remote port check
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Apr 1, 2020
1 parent 6fa2f72 commit 9f7d93b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions docs/API-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ setting the `SRTO_RENDEZVOUS` option to true, and doing `srt_connect`.
* `SRT_ECONNSOCK`: Socket `u` is already connected
* `SRT_ECONNREJ`: Connection has been rejected

**NOTE:** The port value shall be the same in `local_name` and `remote_name`.

IMPORTANT: It's not allowed to perform a rendezvous connection to two
different families (that is, both `local_name` and `remote_name` must be `AF_INET` or
`AF_INET6`).
Expand Down
7 changes: 2 additions & 5 deletions srtcore/srt_c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ int srt_rendezvous(SRTSOCKET u, const struct sockaddr* local_name, int local_nam
sockaddr_in* local_sin = (sockaddr_in*)local_name;
sockaddr_in* remote_sin = (sockaddr_in*)remote_name;

if (local_sin->sin_port != remote_sin->sin_port)
return CUDT::APIError(MJ_NOTSUP, MN_INVAL, 0);

int st = srt_bind(u, local_name, local_namelen);
if ( st != 0 )
const int st = srt_bind(u, local_name, local_namelen);
if (st != 0)
return st;

return srt_connect(u, remote_name, remote_namelen);
Expand Down

0 comments on commit 9f7d93b

Please sign in to comment.