{"action":"created","comment":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/87619478","pull_request_review_id":8227947,"id":87619478,"diff_hunk":"@@ -53,37 +54,66 @@ class QueryContext : public NonMovable, public NonCopyable {\n     }\n };\n \n+struct evdns_base_deleter {\n+    void operator()(evdns_base* p) {\n+        constexpr int fail_requests = 1;\n+        evdns_base_free(p, fail_requests);\n+    }\n+};\n+\n+struct evaddrinfo_deleter {\n+    void operator()(evutil_addrinfo* p) {\n+        evutil_freeaddrinfo(p);\n+    }\n+};\n+\n+using evdns_base_uptr = std::unique_ptr<evdns_base, evdns_base_deleter>;\n+using evaddrinfo_uptr = std::unique_ptr<evutil_addrinfo, evaddrinfo_deleter>;\n+\n template <MK_MOCK(evdns_base_new), MK_MOCK(evdns_base_nameserver_ip_add),\n         MK_MOCK(evdns_base_free), MK_MOCK(evdns_base_set_option)>\n static inline evdns_base *create_evdns_base(\n         Settings settings, Var<Reactor> reactor = Reactor::global()) {\n \n-    evdns_base *base;\n     event_base *evb = reactor->get_event_base();\n+    const int initialize_nameservers = settings.count(\"dns/nameserver\") ? 0 : 1;\n+    evdns_base_uptr base(evdns_base_new(evb, initialize_nameservers));\n+    if (!base) {\n+        throw std::bad_alloc();\n+    }\n \n-    if (settings.find(\"dns/nameserver\") != settings.end()) {\n-        if ((base = evdns_base_new(evb, 0)) == nullptr) {\n-            throw std::bad_alloc();\n+    if (settings.count(\"dns/nameserver\")) {\n+        // libevent can't handle link-local IPv6 nameserver in\n+        // evdns_base_nameserver_ip_add, and there is no way to parse alike\n+        // addresses in platform-independent way, so that's why getaddrinfo().\n+        // fe80::227:22ff:fe45:3a92%wlan0 -- Android\n+        // fe80::227:22ff:fe45:3a92%wlp1s0 -- Ubuntu Linux\n+        evutil_addrinfo hints = { };","path":"src/libmeasurement_kit/libevent/dns_impl.hpp","position":50,"original_position":50,"commit_id":"1ee3803dfd21d662be18a5b0285c13b0227878f7","original_commit_id":"1ee3803dfd21d662be18a5b0285c13b0227878f7","user":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"body":"I assume here you're assigning to zero the POD. I seem to remember that assigning to `{}` has this effect. Is my understanding correct? Do you have a reference explaining that behavior?","created_at":"2016-11-11T16:48:46Z","updated_at":"2016-11-11T16:48:46Z","html_url":"https://github.com/measurement-kit/measurement-kit/pull/915#discussion_r87619478","pull_request_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915","_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/87619478"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/915#discussion_r87619478"},"pull_request":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915"}}},"pull_request":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915","id":93344851,"html_url":"https://github.com/measurement-kit/measurement-kit/pull/915","diff_url":"https://github.com/measurement-kit/measurement-kit/pull/915.diff","patch_url":"https://github.com/measurement-kit/measurement-kit/pull/915.patch","issue_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/915","number":915,"state":"open","locked":false,"title":"Support IPv6 link-local resolver","user":{"login":"darkk","id":21046,"avatar_url":"https://avatars.githubusercontent.com/u/21046?v=3","gravatar_id":"","url":"https://api.github.com/users/darkk","html_url":"https://github.com/darkk","followers_url":"https://api.github.com/users/darkk/followers","following_url":"https://api.github.com/users/darkk/following{/other_user}","gists_url":"https://api.github.com/users/darkk/gists{/gist_id}","starred_url":"https://api.github.com/users/darkk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkk/subscriptions","organizations_url":"https://api.github.com/users/darkk/orgs","repos_url":"https://api.github.com/users/darkk/repos","events_url":"https://api.github.com/users/darkk/events{/privacy}","received_events_url":"https://api.github.com/users/darkk/received_events","type":"User","site_admin":false},"body":"Works-on-my-machine.jpeg (Ubuntu Linux), should work for Android as well.","created_at":"2016-11-11T14:59:28Z","updated_at":"2016-11-11T16:48:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc6653706a8577ffe5fa2cc3bdeef1262efba0f9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915/commits","review_comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915/comments","review_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/915/comments","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/1ee3803dfd21d662be18a5b0285c13b0227878f7","head":{"label":"measurement-kit:feature/dns-query-nameserver-argument","ref":"feature/dns-query-nameserver-argument","sha":"1ee3803dfd21d662be18a5b0285c13b0227878f7","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-10-24T21:30:56Z","pushed_at":"2016-11-11T16:32:24Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":12467,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":101,"forks":6,"open_issues":101,"watchers":22,"default_branch":"master"}},"base":{"label":"measurement-kit:master","ref":"master","sha":"67441ddee9bc1e6057982efa7757522844b34426","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-10-24T21:30:56Z","pushed_at":"2016-11-11T16:32:24Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":12467,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":101,"forks":6,"open_issues":101,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/915"},"issue":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/915"},"comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/915/comments"},"review_comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915/comments"},"review_comment":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/915/commits"},"statuses":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/1ee3803dfd21d662be18a5b0285c13b0227878f7"}}}}
{"actor":{"display_login":"bassosimone"}}