{"action":"created","comment":{"url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments/180001150","pull_request_review_id":110344120,"id":180001150,"diff_hunk":"@@ -1037,17 +1039,43 @@ static BOOL rdg_tls_in_connect(rdpRdg* rdg, const char* hostname, UINT16 port, i\n \t\tpeerPort = settings->ProxyPort;\n \t\tisProxyConnection = TRUE;\n \t}\n+\telse\n+\t{\n+\t\t// if settings->GatewayHostname is a name, it may be mapped to more than one","path":"libfreerdp/core/gateway/rdg.c","position":18,"original_position":18,"commit_id":"ec5130f5e07cf9638be62b55357b8279beb9ab87","original_commit_id":"ec5130f5e07cf9638be62b55357b8279beb9ab87","user":{"login":"akallabeth","id":3472254,"avatar_url":"https://avatars2.githubusercontent.com/u/3472254?v=4","gravatar_id":"","url":"https://api.github.com/users/akallabeth","html_url":"https://github.com/akallabeth","followers_url":"https://api.github.com/users/akallabeth/followers","following_url":"https://api.github.com/users/akallabeth/following{/other_user}","gists_url":"https://api.github.com/users/akallabeth/gists{/gist_id}","starred_url":"https://api.github.com/users/akallabeth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akallabeth/subscriptions","organizations_url":"https://api.github.com/users/akallabeth/orgs","repos_url":"https://api.github.com/users/akallabeth/repos","events_url":"https://api.github.com/users/akallabeth/events{/privacy}","received_events_url":"https://api.github.com/users/akallabeth/received_events","type":"User","site_admin":false},"body":"Sorry to bother again, but we use plain C, so no C++ comments allowed.","created_at":"2018-04-09T06:53:00Z","updated_at":"2018-04-09T06:53:00Z","html_url":"https://github.com/FreeRDP/FreeRDP/pull/4547#discussion_r180001150","pull_request_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments/180001150"},"html":{"href":"https://github.com/FreeRDP/FreeRDP/pull/4547#discussion_r180001150"},"pull_request":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547"}}},"pull_request":{"url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547","id":180117962,"html_url":"https://github.com/FreeRDP/FreeRDP/pull/4547","diff_url":"https://github.com/FreeRDP/FreeRDP/pull/4547.diff","patch_url":"https://github.com/FreeRDP/FreeRDP/pull/4547.patch","issue_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/4547","number":4547,"state":"open","locked":false,"title":"Gateway client (RDG) must connect to same IP/server for both channels","user":{"login":"andreesteve","id":942449,"avatar_url":"https://avatars0.githubusercontent.com/u/942449?v=4","gravatar_id":"","url":"https://api.github.com/users/andreesteve","html_url":"https://github.com/andreesteve","followers_url":"https://api.github.com/users/andreesteve/followers","following_url":"https://api.github.com/users/andreesteve/following{/other_user}","gists_url":"https://api.github.com/users/andreesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/andreesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreesteve/subscriptions","organizations_url":"https://api.github.com/users/andreesteve/orgs","repos_url":"https://api.github.com/users/andreesteve/repos","events_url":"https://api.github.com/users/andreesteve/events{/privacy}","received_events_url":"https://api.github.com/users/andreesteve/received_events","type":"User","site_admin":false},"body":"## Problem description\r\n * Gateway connection fails when gateway name is associated to more than a single IP #4222 \r\n\r\nCurrently RDG first opens the OUT channel and the subsequently the IN channel. Each channel calls the underlying **tcp.h** available functions to resolve the peer address from its name (settings->GatewayHostname). The issue arises when the gateway name points to multiple IPs and the IN channel is opened against one IP and the OUT channel against a different one.\r\n\r\nFor example, imagine a large organization that wants to scale the number of concurrent users they can have through their gateway. It can set their gateway name have multiple [A-records](https://en.wikipedia.org/wiki/List_of_DNS_record_types) so they can have different IPs and gateway servers serving connections to a single gateway hostname.\r\n\r\nFrom my observations, the RDG protocol does not support the IN and OUT channels to be handled by different gateway servers. Thus the need of guaranteeing that we pick a single server/IP to connect for both channels.\r\n\r\n## Proposed solution\r\n\r\n1. Added **freerdp_tcp_get_peer_address** to *tcp.c/h* that allows one to resolve the peer (remote) address from a socket\r\n2. When opening the IN channel in *rdg.c* I first take the already connected socket for the OUT channel, get the peer address using (1) and use it to create the IN channel\r\n\r\n## Notes\r\n\r\nWhen a proxy is used between client and server, my understanding is that the proxy is the one to resolve the gateway hostname, thus no changes were made for this scenario.","created_at":"2018-04-07T18:18:46Z","updated_at":"2018-04-09T06:53:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cfc866cbce3da1534582502b2cfd5d208c575127","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/FreeRDP/FreeRDP/milestones/9","html_url":"https://github.com/FreeRDP/FreeRDP/milestone/9","labels_url":"https://api.github.com/repos/FreeRDP/FreeRDP/milestones/9/labels","id":3217322,"number":9,"title":"2.0-rc3","description":"","creator":{"login":"bmiklautz","id":195793,"avatar_url":"https://avatars0.githubusercontent.com/u/195793?v=4","gravatar_id":"","url":"https://api.github.com/users/bmiklautz","html_url":"https://github.com/bmiklautz","followers_url":"https://api.github.com/users/bmiklautz/followers","following_url":"https://api.github.com/users/bmiklautz/following{/other_user}","gists_url":"https://api.github.com/users/bmiklautz/gists{/gist_id}","starred_url":"https://api.github.com/users/bmiklautz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmiklautz/subscriptions","organizations_url":"https://api.github.com/users/bmiklautz/orgs","repos_url":"https://api.github.com/users/bmiklautz/repos","events_url":"https://api.github.com/users/bmiklautz/events{/privacy}","received_events_url":"https://api.github.com/users/bmiklautz/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":0,"state":"open","created_at":"2018-03-26T13:40:09Z","updated_at":"2018-04-09T06:51:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547/commits","review_comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547/comments","review_comment_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/4547/comments","statuses_url":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/ec5130f5e07cf9638be62b55357b8279beb9ab87","head":{"label":"andreesteve:gatewayip","ref":"gatewayip","sha":"ec5130f5e07cf9638be62b55357b8279beb9ab87","user":{"login":"andreesteve","id":942449,"avatar_url":"https://avatars0.githubusercontent.com/u/942449?v=4","gravatar_id":"","url":"https://api.github.com/users/andreesteve","html_url":"https://github.com/andreesteve","followers_url":"https://api.github.com/users/andreesteve/followers","following_url":"https://api.github.com/users/andreesteve/following{/other_user}","gists_url":"https://api.github.com/users/andreesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/andreesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreesteve/subscriptions","organizations_url":"https://api.github.com/users/andreesteve/orgs","repos_url":"https://api.github.com/users/andreesteve/repos","events_url":"https://api.github.com/users/andreesteve/events{/privacy}","received_events_url":"https://api.github.com/users/andreesteve/received_events","type":"User","site_admin":false},"repo":{"id":125317144,"name":"FreeRDP","full_name":"andreesteve/FreeRDP","owner":{"login":"andreesteve","id":942449,"avatar_url":"https://avatars0.githubusercontent.com/u/942449?v=4","gravatar_id":"","url":"https://api.github.com/users/andreesteve","html_url":"https://github.com/andreesteve","followers_url":"https://api.github.com/users/andreesteve/followers","following_url":"https://api.github.com/users/andreesteve/following{/other_user}","gists_url":"https://api.github.com/users/andreesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/andreesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreesteve/subscriptions","organizations_url":"https://api.github.com/users/andreesteve/orgs","repos_url":"https://api.github.com/users/andreesteve/repos","events_url":"https://api.github.com/users/andreesteve/events{/privacy}","received_events_url":"https://api.github.com/users/andreesteve/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreesteve/FreeRDP","description":"FreeRDP is a free remote desktop protocol library and clients","fork":true,"url":"https://api.github.com/repos/andreesteve/FreeRDP","forks_url":"https://api.github.com/repos/andreesteve/FreeRDP/forks","keys_url":"https://api.github.com/repos/andreesteve/FreeRDP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreesteve/FreeRDP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreesteve/FreeRDP/teams","hooks_url":"https://api.github.com/repos/andreesteve/FreeRDP/hooks","issue_events_url":"https://api.github.com/repos/andreesteve/FreeRDP/issues/events{/number}","events_url":"https://api.github.com/repos/andreesteve/FreeRDP/events","assignees_url":"https://api.github.com/repos/andreesteve/FreeRDP/assignees{/user}","branches_url":"https://api.github.com/repos/andreesteve/FreeRDP/branches{/branch}","tags_url":"https://api.github.com/repos/andreesteve/FreeRDP/tags","blobs_url":"https://api.github.com/repos/andreesteve/FreeRDP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreesteve/FreeRDP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreesteve/FreeRDP/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreesteve/FreeRDP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreesteve/FreeRDP/statuses/{sha}","languages_url":"https://api.github.com/repos/andreesteve/FreeRDP/languages","stargazers_url":"https://api.github.com/repos/andreesteve/FreeRDP/stargazers","contributors_url":"https://api.github.com/repos/andreesteve/FreeRDP/contributors","subscribers_url":"https://api.github.com/repos/andreesteve/FreeRDP/subscribers","subscription_url":"https://api.github.com/repos/andreesteve/FreeRDP/subscription","commits_url":"https://api.github.com/repos/andreesteve/FreeRDP/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreesteve/FreeRDP/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreesteve/FreeRDP/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreesteve/FreeRDP/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreesteve/FreeRDP/contents/{+path}","compare_url":"https://api.github.com/repos/andreesteve/FreeRDP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreesteve/FreeRDP/merges","archive_url":"https://api.github.com/repos/andreesteve/FreeRDP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreesteve/FreeRDP/downloads","issues_url":"https://api.github.com/repos/andreesteve/FreeRDP/issues{/number}","pulls_url":"https://api.github.com/repos/andreesteve/FreeRDP/pulls{/number}","milestones_url":"https://api.github.com/repos/andreesteve/FreeRDP/milestones{/number}","notifications_url":"https://api.github.com/repos/andreesteve/FreeRDP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreesteve/FreeRDP/labels{/name}","releases_url":"https://api.github.com/repos/andreesteve/FreeRDP/releases{/id}","deployments_url":"https://api.github.com/repos/andreesteve/FreeRDP/deployments","created_at":"2018-03-15T05:32:15Z","updated_at":"2018-04-07T17:50:18Z","pushed_at":"2018-04-08T23:04:10Z","git_url":"git://github.com/andreesteve/FreeRDP.git","ssh_url":"git@github.com:andreesteve/FreeRDP.git","clone_url":"https://github.com/andreesteve/FreeRDP.git","svn_url":"https://github.com/andreesteve/FreeRDP","homepage":"http://www.freerdp.com/","size":34662,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FreeRDP:master","ref":"master","sha":"a9ecd6a6ccc71130805a6bf3214c169fc42746ba","user":{"login":"FreeRDP","id":663376,"avatar_url":"https://avatars0.githubusercontent.com/u/663376?v=4","gravatar_id":"","url":"https://api.github.com/users/FreeRDP","html_url":"https://github.com/FreeRDP","followers_url":"https://api.github.com/users/FreeRDP/followers","following_url":"https://api.github.com/users/FreeRDP/following{/other_user}","gists_url":"https://api.github.com/users/FreeRDP/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeRDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeRDP/subscriptions","organizations_url":"https://api.github.com/users/FreeRDP/orgs","repos_url":"https://api.github.com/users/FreeRDP/repos","events_url":"https://api.github.com/users/FreeRDP/events{/privacy}","received_events_url":"https://api.github.com/users/FreeRDP/received_events","type":"Organization","site_admin":false},"repo":{"id":1979797,"name":"FreeRDP","full_name":"FreeRDP/FreeRDP","owner":{"login":"FreeRDP","id":663376,"avatar_url":"https://avatars0.githubusercontent.com/u/663376?v=4","gravatar_id":"","url":"https://api.github.com/users/FreeRDP","html_url":"https://github.com/FreeRDP","followers_url":"https://api.github.com/users/FreeRDP/followers","following_url":"https://api.github.com/users/FreeRDP/following{/other_user}","gists_url":"https://api.github.com/users/FreeRDP/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeRDP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeRDP/subscriptions","organizations_url":"https://api.github.com/users/FreeRDP/orgs","repos_url":"https://api.github.com/users/FreeRDP/repos","events_url":"https://api.github.com/users/FreeRDP/events{/privacy}","received_events_url":"https://api.github.com/users/FreeRDP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FreeRDP/FreeRDP","description":"FreeRDP is a free remote desktop protocol library and clients","fork":false,"url":"https://api.github.com/repos/FreeRDP/FreeRDP","forks_url":"https://api.github.com/repos/FreeRDP/FreeRDP/forks","keys_url":"https://api.github.com/repos/FreeRDP/FreeRDP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FreeRDP/FreeRDP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FreeRDP/FreeRDP/teams","hooks_url":"https://api.github.com/repos/FreeRDP/FreeRDP/hooks","issue_events_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/events{/number}","events_url":"https://api.github.com/repos/FreeRDP/FreeRDP/events","assignees_url":"https://api.github.com/repos/FreeRDP/FreeRDP/assignees{/user}","branches_url":"https://api.github.com/repos/FreeRDP/FreeRDP/branches{/branch}","tags_url":"https://api.github.com/repos/FreeRDP/FreeRDP/tags","blobs_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/refs{/sha}","trees_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/{sha}","languages_url":"https://api.github.com/repos/FreeRDP/FreeRDP/languages","stargazers_url":"https://api.github.com/repos/FreeRDP/FreeRDP/stargazers","contributors_url":"https://api.github.com/repos/FreeRDP/FreeRDP/contributors","subscribers_url":"https://api.github.com/repos/FreeRDP/FreeRDP/subscribers","subscription_url":"https://api.github.com/repos/FreeRDP/FreeRDP/subscription","commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/commits{/sha}","git_commits_url":"https://api.github.com/repos/FreeRDP/FreeRDP/git/commits{/sha}","comments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/comments{/number}","issue_comment_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/comments{/number}","contents_url":"https://api.github.com/repos/FreeRDP/FreeRDP/contents/{+path}","compare_url":"https://api.github.com/repos/FreeRDP/FreeRDP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FreeRDP/FreeRDP/merges","archive_url":"https://api.github.com/repos/FreeRDP/FreeRDP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FreeRDP/FreeRDP/downloads","issues_url":"https://api.github.com/repos/FreeRDP/FreeRDP/issues{/number}","pulls_url":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls{/number}","milestones_url":"https://api.github.com/repos/FreeRDP/FreeRDP/milestones{/number}","notifications_url":"https://api.github.com/repos/FreeRDP/FreeRDP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FreeRDP/FreeRDP/labels{/name}","releases_url":"https://api.github.com/repos/FreeRDP/FreeRDP/releases{/id}","deployments_url":"https://api.github.com/repos/FreeRDP/FreeRDP/deployments","created_at":"2011-06-30T19:14:15Z","updated_at":"2018-04-09T05:22:26Z","pushed_at":"2018-04-08T23:04:13Z","git_url":"git://github.com/FreeRDP/FreeRDP.git","ssh_url":"git@github.com:FreeRDP/FreeRDP.git","clone_url":"https://github.com/FreeRDP/FreeRDP.git","svn_url":"https://github.com/FreeRDP/FreeRDP","homepage":"http://www.freerdp.com/","size":34654,"stargazers_count":2303,"watchers_count":2303,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1095,"mirror_url":null,"archived":false,"open_issues_count":491,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1095,"open_issues":491,"watchers":2303,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547"},"html":{"href":"https://github.com/FreeRDP/FreeRDP/pull/4547"},"issue":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/4547"},"comments":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/issues/4547/comments"},"review_comments":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547/comments"},"review_comment":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/pulls/4547/commits"},"statuses":{"href":"https://api.github.com/repos/FreeRDP/FreeRDP/statuses/ec5130f5e07cf9638be62b55357b8279beb9ab87"}},"author_association":"NONE"}}
{"actor":{"display_login":"akallabeth"}}