{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/facter/pulls/comments/36027038","id":36027038,"diff_hunk":"@@ -120,4 +120,32 @@ namespace facter { namespace facts { namespace posix {\n         return result;\n     }\n \n+    void networking_resolver::assign_address(ipaddress& ip, sockaddr const* address, sockaddr const* mask) const\n+    {\n+        if (!address) {\n+           return;\n+        }\n+\n+        string* assigned = nullptr;\n+        bool (*ignored)(string const&) = nullptr;\n+\n+        // Check for IPv4 or IPv6 addresses\n+        if (address->sa_family == AF_INET) {\n+            assigned = &ip.v4;\n+            ignored = ignored_ipv4_address;\n+        } else if (address->sa_family == AF_INET6) {\n+            assigned = &ip.v6;\n+            ignored = ignored_ipv6_address;\n+        } else {\n+            return;\n+        }\n+\n+        // If the current address is not ignored or there is existing ignored address, do not assign\n+        if (!ignored(*assigned) || !assigned->empty()) {","path":"lib/src/facts/posix/networking_resolver.cc","position":25,"original_position":25,"commit_id":"3ab64d9396ba82b3c16ad8e1697f831d7de496f1","original_commit_id":"3ab64d9396ba82b3c16ad8e1697f831d7de496f1","user":{"login":"peterhuene","id":509666,"avatar_url":"https://avatars.githubusercontent.com/u/509666?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhuene","html_url":"https://github.com/peterhuene","followers_url":"https://api.github.com/users/peterhuene/followers","following_url":"https://api.github.com/users/peterhuene/following{/other_user}","gists_url":"https://api.github.com/users/peterhuene/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhuene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhuene/subscriptions","organizations_url":"https://api.github.com/users/peterhuene/orgs","repos_url":"https://api.github.com/users/peterhuene/repos","events_url":"https://api.github.com/users/peterhuene/events{/privacy}","received_events_url":"https://api.github.com/users/peterhuene/received_events","type":"User","site_admin":false},"body":"Checking for just not assigned will prevent a non-link-local address from overwriting a link-local address, though ","created_at":"2015-08-01T00:05:37Z","updated_at":"2015-08-01T00:05:37Z","html_url":"https://github.com/puppetlabs/facter/pull/1081#discussion_r36027038","pull_request_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1081","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/comments/36027038"},"html":{"href":"https://github.com/puppetlabs/facter/pull/1081#discussion_r36027038"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1081"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/facter/pulls/1081","id":40955170,"html_url":"https://github.com/puppetlabs/facter/pull/1081","diff_url":"https://github.com/puppetlabs/facter/pull/1081.diff","patch_url":"https://github.com/puppetlabs/facter/pull/1081.patch","issue_url":"https://api.github.com/repos/puppetlabs/facter/issues/1081","number":1081,"state":"open","locked":false,"title":"(FACT-1147, FACT-1150) Fix network interfaces with multiple addresses.","user":{"login":"peterhuene","id":509666,"avatar_url":"https://avatars.githubusercontent.com/u/509666?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhuene","html_url":"https://github.com/peterhuene","followers_url":"https://api.github.com/users/peterhuene/followers","following_url":"https://api.github.com/users/peterhuene/following{/other_user}","gists_url":"https://api.github.com/users/peterhuene/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhuene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhuene/subscriptions","organizations_url":"https://api.github.com/users/peterhuene/orgs","repos_url":"https://api.github.com/users/peterhuene/repos","events_url":"https://api.github.com/users/peterhuene/events{/privacy}","received_events_url":"https://api.github.com/users/peterhuene/received_events","type":"User","site_admin":false},"body":"The BSD networking resolver (Linux, *BSDs) was overwriting existing\r\naddress information (ip, ip6, netmask, network) with \"secondary\"\r\naddresses that come later in the linked list returned from the kernel.\r\n\r\nThis was happening when all addresses were link-local and\r\nthe last address was being selected (FACT-1147).\r\n\r\nThis was also happening when a global address came first and was being\r\noverwritten by a link-local address that came later (FACT-1150).\r\n\r\nThe fix is to alter the behavior to select the first non-local address\r\non the interface.  If all addresses are link-local, then the first\r\naddress is used.\r\n","created_at":"2015-07-27T22:06:57Z","updated_at":"2015-08-01T00:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"782496280de14d2f6634461a39224eea73b3d515","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1081/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/facter/pulls/1081/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/facter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/facter/issues/1081/comments","statuses_url":"https://api.github.com/repos/puppetlabs/facter/statuses/3ab64d9396ba82b3c16ad8e1697f831d7de496f1","head":{"label":"peterhuene:fact/1150","ref":"fact/1150","sha":"3ab64d9396ba82b3c16ad8e1697f831d7de496f1","user":{"login":"peterhuene","id":509666,"avatar_url":"https://avatars.githubusercontent.com/u/509666?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhuene","html_url":"https://github.com/peterhuene","followers_url":"https://api.github.com/users/peterhuene/followers","following_url":"https://api.github.com/users/peterhuene/following{/other_user}","gists_url":"https://api.github.com/users/peterhuene/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhuene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhuene/subscriptions","organizations_url":"https://api.github.com/users/peterhuene/orgs","repos_url":"https://api.github.com/users/peterhuene/repos","events_url":"https://api.github.com/users/peterhuene/events{/privacy}","received_events_url":"https://api.github.com/users/peterhuene/received_events","type":"User","site_admin":false},"repo":{"id":15720773,"name":"facter","full_name":"peterhuene/facter","owner":{"login":"peterhuene","id":509666,"avatar_url":"https://avatars.githubusercontent.com/u/509666?v=3","gravatar_id":"","url":"https://api.github.com/users/peterhuene","html_url":"https://github.com/peterhuene","followers_url":"https://api.github.com/users/peterhuene/followers","following_url":"https://api.github.com/users/peterhuene/following{/other_user}","gists_url":"https://api.github.com/users/peterhuene/gists{/gist_id}","starred_url":"https://api.github.com/users/peterhuene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterhuene/subscriptions","organizations_url":"https://api.github.com/users/peterhuene/orgs","repos_url":"https://api.github.com/users/peterhuene/repos","events_url":"https://api.github.com/users/peterhuene/events{/privacy}","received_events_url":"https://api.github.com/users/peterhuene/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peterhuene/facter","description":"","fork":true,"url":"https://api.github.com/repos/peterhuene/facter","forks_url":"https://api.github.com/repos/peterhuene/facter/forks","keys_url":"https://api.github.com/repos/peterhuene/facter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peterhuene/facter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peterhuene/facter/teams","hooks_url":"https://api.github.com/repos/peterhuene/facter/hooks","issue_events_url":"https://api.github.com/repos/peterhuene/facter/issues/events{/number}","events_url":"https://api.github.com/repos/peterhuene/facter/events","assignees_url":"https://api.github.com/repos/peterhuene/facter/assignees{/user}","branches_url":"https://api.github.com/repos/peterhuene/facter/branches{/branch}","tags_url":"https://api.github.com/repos/peterhuene/facter/tags","blobs_url":"https://api.github.com/repos/peterhuene/facter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peterhuene/facter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peterhuene/facter/git/refs{/sha}","trees_url":"https://api.github.com/repos/peterhuene/facter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peterhuene/facter/statuses/{sha}","languages_url":"https://api.github.com/repos/peterhuene/facter/languages","stargazers_url":"https://api.github.com/repos/peterhuene/facter/stargazers","contributors_url":"https://api.github.com/repos/peterhuene/facter/contributors","subscribers_url":"https://api.github.com/repos/peterhuene/facter/subscribers","subscription_url":"https://api.github.com/repos/peterhuene/facter/subscription","commits_url":"https://api.github.com/repos/peterhuene/facter/commits{/sha}","git_commits_url":"https://api.github.com/repos/peterhuene/facter/git/commits{/sha}","comments_url":"https://api.github.com/repos/peterhuene/facter/comments{/number}","issue_comment_url":"https://api.github.com/repos/peterhuene/facter/issues/comments{/number}","contents_url":"https://api.github.com/repos/peterhuene/facter/contents/{+path}","compare_url":"https://api.github.com/repos/peterhuene/facter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peterhuene/facter/merges","archive_url":"https://api.github.com/repos/peterhuene/facter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peterhuene/facter/downloads","issues_url":"https://api.github.com/repos/peterhuene/facter/issues{/number}","pulls_url":"https://api.github.com/repos/peterhuene/facter/pulls{/number}","milestones_url":"https://api.github.com/repos/peterhuene/facter/milestones{/number}","notifications_url":"https://api.github.com/repos/peterhuene/facter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peterhuene/facter/labels{/name}","releases_url":"https://api.github.com/repos/peterhuene/facter/releases{/id}","created_at":"2014-01-08T00:16:20Z","updated_at":"2015-05-07T20:14:35Z","pushed_at":"2015-07-27T23:12:19Z","git_url":"git://github.com/peterhuene/facter.git","ssh_url":"git@github.com:peterhuene/facter.git","clone_url":"https://github.com/peterhuene/facter.git","svn_url":"https://github.com/peterhuene/facter","homepage":"http://projects.puppetlabs.com/projects/facter","size":11697,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:stable","ref":"stable","sha":"49b691982a8c2063352c5ae2fe7e3f37d9586e4d","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910757,"name":"facter","full_name":"puppetlabs/facter","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/facter","description":"Collect and display system facts","fork":false,"url":"https://api.github.com/repos/puppetlabs/facter","forks_url":"https://api.github.com/repos/puppetlabs/facter/forks","keys_url":"https://api.github.com/repos/puppetlabs/facter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/facter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/facter/teams","hooks_url":"https://api.github.com/repos/puppetlabs/facter/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/facter/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/facter/events","assignees_url":"https://api.github.com/repos/puppetlabs/facter/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/facter/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/facter/tags","blobs_url":"https://api.github.com/repos/puppetlabs/facter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/facter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/facter/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/facter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/facter/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/facter/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/facter/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/facter/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/facter/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/facter/subscription","commits_url":"https://api.github.com/repos/puppetlabs/facter/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/facter/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/facter/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/facter/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/facter/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/facter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/facter/merges","archive_url":"https://api.github.com/repos/puppetlabs/facter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/facter/downloads","issues_url":"https://api.github.com/repos/puppetlabs/facter/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/facter/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/facter/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/facter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/facter/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/facter/releases{/id}","created_at":"2010-09-14T19:31:04Z","updated_at":"2015-07-31T08:19:59Z","pushed_at":"2015-07-31T23:22:29Z","git_url":"git://github.com/puppetlabs/facter.git","ssh_url":"git@github.com:puppetlabs/facter.git","clone_url":"https://github.com/puppetlabs/facter.git","svn_url":"https://github.com/puppetlabs/facter","homepage":"https://tickets.puppetlabs.com/browse/FACT","size":21792,"stargazers_count":384,"watchers_count":384,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":365,"mirror_url":null,"open_issues_count":10,"forks":365,"open_issues":10,"watchers":384,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1081"},"html":{"href":"https://github.com/puppetlabs/facter/pull/1081"},"issue":{"href":"https://api.github.com/repos/puppetlabs/facter/issues/1081"},"comments":{"href":"https://api.github.com/repos/puppetlabs/facter/issues/1081/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1081/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/facter/pulls/1081/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/facter/statuses/3ab64d9396ba82b3c16ad8e1697f831d7de496f1"}}}}