{"action":"created","issue":{"url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/165","repository_url":"https://api.github.com/repos/gdkchan/Ryujinx","labels_url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/165/comments","events_url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/165/events","html_url":"https://github.com/gdkchan/Ryujinx/pull/165","id":332705339,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MTIxMjQ1","number":165,"title":"Update BSD service to correctly handle address input buffers","user":{"login":"kbhomes","id":479569,"node_id":"MDQ6VXNlcjQ3OTU2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/479569?v=4","gravatar_id":"","url":"https://api.github.com/users/kbhomes","html_url":"https://github.com/kbhomes","followers_url":"https://api.github.com/users/kbhomes/followers","following_url":"https://api.github.com/users/kbhomes/following{/other_user}","gists_url":"https://api.github.com/users/kbhomes/gists{/gist_id}","starred_url":"https://api.github.com/users/kbhomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbhomes/subscriptions","organizations_url":"https://api.github.com/users/kbhomes/orgs","repos_url":"https://api.github.com/users/kbhomes/repos","events_url":"https://api.github.com/users/kbhomes/events{/privacy}","received_events_url":"https://api.github.com/users/kbhomes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-15T09:26:32Z","updated_at":"2018-06-15T19:34:26Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/gdkchan/Ryujinx/pulls/165","html_url":"https://github.com/gdkchan/Ryujinx/pull/165","diff_url":"https://github.com/gdkchan/Ryujinx/pull/165.diff","patch_url":"https://github.com/gdkchan/Ryujinx/pull/165.patch"},"body":"**EDIT: See later comment that about implementation of this change.**\r\n\r\nThis change updates the way that the BSD service implementation reads the server address info (in `Bind`, `Connect`, `SendTo`) to handle libnx \"smart IPC buffers\". \r\n\r\nInternally, some service API implementations in libnx check if a buffer that is meant to be a Send or Receive buffer in the IPC command can fit directly into a Pointer buffer; if it can, it inserts a blank buffer descriptor into Send/Receive and inserts the real descriptor into Pointer (see [`ipcAddSendSmart` in libnx][1]). \r\n\r\nI implement this change by creating a `ReadSmartBuffer` method that checks if the Send buffer looks blank, and if it is, reads from the corresponding Pointer buffer instead. This fix allows these particular BSD service methods to function properly, since before it would try to read the address information from a blank buffer. You can test it on [this MCV example][2] that demonstrates the issue (compiled version of this example is attached).\r\n\r\nSince I'm unsure of the scope of the usage of these libnx smart buffers throughout all of the service implementations (and whether they cause this bug in other Ryujinx services) and I'm new to the code architecture of Ryujinx, I'm not positive if this smart buffer change should reside within this particular BSD service implementation or should be pulled out into some common area. I would appreciate advice on this! 😄 \r\n\r\n[bsd-connect-example.nro.zip][3]\r\n\r\n[1]: https://github.com/switchbrew/libnx/blob/master/nx/include/switch/kernel/ipc.h#L184\r\n[2]: https://gist.github.com/kbhomes/5165d57df184e6dd1c4f7ad39584990f\r\n[3]: https://github.com/gdkchan/Ryujinx/files/2105525/bsd-connect-example.nro.zip"},"comment":{"url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/comments/397721683","html_url":"https://github.com/gdkchan/Ryujinx/pull/165#issuecomment-397721683","issue_url":"https://api.github.com/repos/gdkchan/Ryujinx/issues/165","id":397721683,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzcyMTY4Mw==","user":{"login":"kbhomes","id":479569,"node_id":"MDQ6VXNlcjQ3OTU2OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/479569?v=4","gravatar_id":"","url":"https://api.github.com/users/kbhomes","html_url":"https://github.com/kbhomes","followers_url":"https://api.github.com/users/kbhomes/followers","following_url":"https://api.github.com/users/kbhomes/following{/other_user}","gists_url":"https://api.github.com/users/kbhomes/gists{/gist_id}","starred_url":"https://api.github.com/users/kbhomes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbhomes/subscriptions","organizations_url":"https://api.github.com/users/kbhomes/orgs","repos_url":"https://api.github.com/users/kbhomes/repos","events_url":"https://api.github.com/users/kbhomes/events{/privacy}","received_events_url":"https://api.github.com/users/kbhomes/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T19:34:26Z","updated_at":"2018-06-15T19:34:26Z","author_association":"NONE","body":"Fixed the bounds check 👍 "}}
{"actor":{"display_login":"kbhomes"}}