{"action":"created","issue":{"url":"https://api.github.com/repos/JiriHorky/privbind/issues/2","labels_url":"https://api.github.com/repos/JiriHorky/privbind/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/JiriHorky/privbind/issues/2/comments","events_url":"https://api.github.com/repos/JiriHorky/privbind/issues/2/events","html_url":"https://github.com/JiriHorky/privbind/pull/2","id":115555717,"number":2,"title":"Makes possible to setup SO_REUSEPORT option before binding to address","user":{"login":"Karry","id":309458,"avatar_url":"https://avatars.githubusercontent.com/u/309458?v=3","gravatar_id":"","url":"https://api.github.com/users/Karry","html_url":"https://github.com/Karry","followers_url":"https://api.github.com/users/Karry/followers","following_url":"https://api.github.com/users/Karry/following{/other_user}","gists_url":"https://api.github.com/users/Karry/gists{/gist_id}","starred_url":"https://api.github.com/users/Karry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Karry/subscriptions","organizations_url":"https://api.github.com/users/Karry/orgs","repos_url":"https://api.github.com/users/Karry/repos","events_url":"https://api.github.com/users/Karry/events{/privacy}","received_events_url":"https://api.github.com/users/Karry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-06T17:56:10Z","updated_at":"2015-11-15T18:35:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JiriHorky/privbind/pulls/2","html_url":"https://github.com/JiriHorky/privbind/pull/2","diff_url":"https://github.com/JiriHorky/privbind/pull/2.diff","patch_url":"https://github.com/JiriHorky/privbind/pull/2.patch"},"body":"With these patches, it is possible to define comma separated list of ports for those should be setup SO_REUSEPORT option before bind. This functionality moves privbind to more universal wrapper.\r\n\r\nIt is possible to run more servers binded to same address with this option (see man 7 socket). It can be useful for programs that don't support reused ports (java based servers) but it is safe to do it. \r\n\r\nTechnical note:\r\nPrivbind setup environment variable PRIVBIND_REUSE_PORTS with list of ports that should be shared (reused), in bind(...) function libprivbind then check this list and setup SO_REUSEPORT when needed...\r\n"},"comment":{"url":"https://api.github.com/repos/JiriHorky/privbind/issues/comments/156842021","html_url":"https://github.com/JiriHorky/privbind/pull/2#issuecomment-156842021","issue_url":"https://api.github.com/repos/JiriHorky/privbind/issues/2","id":156842021,"user":{"login":"JiriHorky","id":427968,"avatar_url":"https://avatars.githubusercontent.com/u/427968?v=3","gravatar_id":"","url":"https://api.github.com/users/JiriHorky","html_url":"https://github.com/JiriHorky","followers_url":"https://api.github.com/users/JiriHorky/followers","following_url":"https://api.github.com/users/JiriHorky/following{/other_user}","gists_url":"https://api.github.com/users/JiriHorky/gists{/gist_id}","starred_url":"https://api.github.com/users/JiriHorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JiriHorky/subscriptions","organizations_url":"https://api.github.com/users/JiriHorky/orgs","repos_url":"https://api.github.com/users/JiriHorky/repos","events_url":"https://api.github.com/users/JiriHorky/events{/privacy}","received_events_url":"https://api.github.com/users/JiriHorky/received_events","type":"User","site_admin":false},"created_at":"2015-11-15T18:35:13Z","updated_at":"2015-11-15T18:35:13Z","body":"Hi Karry, many thanks for this pull request. This functionality may come in handy for application running on newer Linux which are not SO_REUSEPORT compatible.\r\nPlease see my comments for the code, there are small things that I would like to see fixed before I merge the commit. Also, you should probably be checking for the validity of the passed port ( between 1 and 65,535)."}}