{"action":"created","comment":{"url":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments/25245879","id":25245879,"diff_hunk":"@@ -187,10 +180,59 @@ exports.is_ip_in_str = function(ip, str) {\n     return false;\n };\n \n-exports.is_rfc1918 = function (ip) {\n-    return (net.isIPv4(ip) && re_private_ipv4.test(ip));\n+exports.is_private_ipv4 = function (ip) {\n+\n+    // RFC 1918, reserved as \"private\" IP space\n+    if (/^10\\./.test(ip)) return true;          // 10/8\n+    if (/^192\\.168\\./.test(ip)) return true;    // 192.168/16\n+    // 172.16/12  ->   172.16/16 .. 172.31/16\n+    if (/^172\\.(1[6-9]|2[0-9]|3[01])\\./.test(ip)) return true;\n+\n+    return false;\n+};\n+\n+exports.is_local_ipv4 = function (ip) {\n+    // 127/8 (loopback) and 0/8 (this network)  # RFC 1122\n+    if(/^(127|0)\\./.test(ip)) return true;\n+\n+    // link local: 169.254/16) RFC 3927\n+    if (/^169\\.254\\./.test(ip)) return true;\n+\n+    return false;\n+};\n+\n+exports.is_local_ipv6 = function (ip) {","path":"net_utils.js","position":74,"original_position":74,"commit_id":"227ec443d5c268d5b0426a6117c3751cb5645c42","original_commit_id":"227ec443d5c268d5b0426a6117c3751cb5645c42","user":{"login":"smfreegard","id":550490,"avatar_url":"https://avatars.githubusercontent.com/u/550490?v=3","gravatar_id":"","url":"https://api.github.com/users/smfreegard","html_url":"https://github.com/smfreegard","followers_url":"https://api.github.com/users/smfreegard/followers","following_url":"https://api.github.com/users/smfreegard/following{/other_user}","gists_url":"https://api.github.com/users/smfreegard/gists{/gist_id}","starred_url":"https://api.github.com/users/smfreegard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smfreegard/subscriptions","organizations_url":"https://api.github.com/users/smfreegard/orgs","repos_url":"https://api.github.com/users/smfreegard/repos","events_url":"https://api.github.com/users/smfreegard/events{/privacy}","received_events_url":"https://api.github.com/users/smfreegard/received_events","type":"User","site_admin":false},"body":"This function is missing uniqueLocal (fc00::/7)","created_at":"2015-02-24T11:36:37Z","updated_at":"2015-02-24T11:36:37Z","html_url":"https://github.com/baudehlo/Haraka/pull/858#discussion_r25245879","pull_request_url":"https://api.github.com/repos/baudehlo/Haraka/pulls/858","_links":{"self":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments/25245879"},"html":{"href":"https://github.com/baudehlo/Haraka/pull/858#discussion_r25245879"},"pull_request":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/858"}}},"pull_request":{"url":"https://api.github.com/repos/baudehlo/Haraka/pulls/858","id":29767217,"html_url":"https://github.com/baudehlo/Haraka/pull/858","diff_url":"https://github.com/baudehlo/Haraka/pull/858.diff","patch_url":"https://github.com/baudehlo/Haraka/pull/858.patch","issue_url":"https://api.github.com/repos/baudehlo/Haraka/issues/858","number":858,"state":"open","locked":false,"title":"net_utils: refactoring for IPv6 compatibility, simplicity and maintainability","user":{"login":"msimerson","id":261635,"avatar_url":"https://avatars.githubusercontent.com/u/261635?v=3","gravatar_id":"","url":"https://api.github.com/users/msimerson","html_url":"https://github.com/msimerson","followers_url":"https://api.github.com/users/msimerson/followers","following_url":"https://api.github.com/users/msimerson/following{/other_user}","gists_url":"https://api.github.com/users/msimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/msimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimerson/subscriptions","organizations_url":"https://api.github.com/users/msimerson/orgs","repos_url":"https://api.github.com/users/msimerson/repos","events_url":"https://api.github.com/users/msimerson/events{/privacy}","received_events_url":"https://api.github.com/users/msimerson/received_events","type":"User","site_admin":false},"body":"* rename net_utils.is_rfc1918 -> is_private_ip\r\n* closes #850\r\n* added net_utils.is_local_ipv4, is_private_ipv4, & is_local_ipv6.\r\n    * updated is_private_ip to use them\r\n    * adds IPv6 link local to is_private_ip\r\n    * adds additional test coverage\r\n    * considerably easier to maintain than one regex for ipv4 and one for ipv6\r\n    * no significant performance impact (0.05 second difference on 2 million iterations)\r\n    * side note: using ?: in /regex/.test(str) seems to make no performance different (less than rounding error in testing).","created_at":"2015-02-22T07:56:16Z","updated_at":"2015-02-24T11:36:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a88029efb43be95b013c0d315361a99335008a2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/baudehlo/Haraka/pulls/858/commits","review_comments_url":"https://api.github.com/repos/baudehlo/Haraka/pulls/858/comments","review_comment_url":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baudehlo/Haraka/issues/858/comments","statuses_url":"https://api.github.com/repos/baudehlo/Haraka/statuses/227ec443d5c268d5b0426a6117c3751cb5645c42","head":{"label":"msimerson:net_utils","ref":"net_utils","sha":"227ec443d5c268d5b0426a6117c3751cb5645c42","user":{"login":"msimerson","id":261635,"avatar_url":"https://avatars.githubusercontent.com/u/261635?v=3","gravatar_id":"","url":"https://api.github.com/users/msimerson","html_url":"https://github.com/msimerson","followers_url":"https://api.github.com/users/msimerson/followers","following_url":"https://api.github.com/users/msimerson/following{/other_user}","gists_url":"https://api.github.com/users/msimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/msimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimerson/subscriptions","organizations_url":"https://api.github.com/users/msimerson/orgs","repos_url":"https://api.github.com/users/msimerson/repos","events_url":"https://api.github.com/users/msimerson/events{/privacy}","received_events_url":"https://api.github.com/users/msimerson/received_events","type":"User","site_admin":false},"repo":{"id":9718691,"name":"Haraka","full_name":"msimerson/Haraka","owner":{"login":"msimerson","id":261635,"avatar_url":"https://avatars.githubusercontent.com/u/261635?v=3","gravatar_id":"","url":"https://api.github.com/users/msimerson","html_url":"https://github.com/msimerson","followers_url":"https://api.github.com/users/msimerson/followers","following_url":"https://api.github.com/users/msimerson/following{/other_user}","gists_url":"https://api.github.com/users/msimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/msimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimerson/subscriptions","organizations_url":"https://api.github.com/users/msimerson/orgs","repos_url":"https://api.github.com/users/msimerson/repos","events_url":"https://api.github.com/users/msimerson/events{/privacy}","received_events_url":"https://api.github.com/users/msimerson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/msimerson/Haraka","description":"An event driven SMTP server","fork":true,"url":"https://api.github.com/repos/msimerson/Haraka","forks_url":"https://api.github.com/repos/msimerson/Haraka/forks","keys_url":"https://api.github.com/repos/msimerson/Haraka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msimerson/Haraka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msimerson/Haraka/teams","hooks_url":"https://api.github.com/repos/msimerson/Haraka/hooks","issue_events_url":"https://api.github.com/repos/msimerson/Haraka/issues/events{/number}","events_url":"https://api.github.com/repos/msimerson/Haraka/events","assignees_url":"https://api.github.com/repos/msimerson/Haraka/assignees{/user}","branches_url":"https://api.github.com/repos/msimerson/Haraka/branches{/branch}","tags_url":"https://api.github.com/repos/msimerson/Haraka/tags","blobs_url":"https://api.github.com/repos/msimerson/Haraka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msimerson/Haraka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msimerson/Haraka/git/refs{/sha}","trees_url":"https://api.github.com/repos/msimerson/Haraka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msimerson/Haraka/statuses/{sha}","languages_url":"https://api.github.com/repos/msimerson/Haraka/languages","stargazers_url":"https://api.github.com/repos/msimerson/Haraka/stargazers","contributors_url":"https://api.github.com/repos/msimerson/Haraka/contributors","subscribers_url":"https://api.github.com/repos/msimerson/Haraka/subscribers","subscription_url":"https://api.github.com/repos/msimerson/Haraka/subscription","commits_url":"https://api.github.com/repos/msimerson/Haraka/commits{/sha}","git_commits_url":"https://api.github.com/repos/msimerson/Haraka/git/commits{/sha}","comments_url":"https://api.github.com/repos/msimerson/Haraka/comments{/number}","issue_comment_url":"https://api.github.com/repos/msimerson/Haraka/issues/comments{/number}","contents_url":"https://api.github.com/repos/msimerson/Haraka/contents/{+path}","compare_url":"https://api.github.com/repos/msimerson/Haraka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msimerson/Haraka/merges","archive_url":"https://api.github.com/repos/msimerson/Haraka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msimerson/Haraka/downloads","issues_url":"https://api.github.com/repos/msimerson/Haraka/issues{/number}","pulls_url":"https://api.github.com/repos/msimerson/Haraka/pulls{/number}","milestones_url":"https://api.github.com/repos/msimerson/Haraka/milestones{/number}","notifications_url":"https://api.github.com/repos/msimerson/Haraka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msimerson/Haraka/labels{/name}","releases_url":"https://api.github.com/repos/msimerson/Haraka/releases{/id}","created_at":"2013-04-27T17:45:55Z","updated_at":"2015-02-22T20:12:54Z","pushed_at":"2015-02-24T00:50:27Z","git_url":"git://github.com/msimerson/Haraka.git","ssh_url":"git@github.com:msimerson/Haraka.git","clone_url":"https://github.com/msimerson/Haraka.git","svn_url":"https://github.com/msimerson/Haraka","homepage":"http://haraka.github.com/","size":7151,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"baudehlo:master","ref":"master","sha":"7238f33c7cebf0bcd13126a0b9551598d11f1af8","user":{"login":"baudehlo","id":662371,"avatar_url":"https://avatars.githubusercontent.com/u/662371?v=3","gravatar_id":"","url":"https://api.github.com/users/baudehlo","html_url":"https://github.com/baudehlo","followers_url":"https://api.github.com/users/baudehlo/followers","following_url":"https://api.github.com/users/baudehlo/following{/other_user}","gists_url":"https://api.github.com/users/baudehlo/gists{/gist_id}","starred_url":"https://api.github.com/users/baudehlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baudehlo/subscriptions","organizations_url":"https://api.github.com/users/baudehlo/orgs","repos_url":"https://api.github.com/users/baudehlo/repos","events_url":"https://api.github.com/users/baudehlo/events{/privacy}","received_events_url":"https://api.github.com/users/baudehlo/received_events","type":"User","site_admin":false},"repo":{"id":1464380,"name":"Haraka","full_name":"baudehlo/Haraka","owner":{"login":"baudehlo","id":662371,"avatar_url":"https://avatars.githubusercontent.com/u/662371?v=3","gravatar_id":"","url":"https://api.github.com/users/baudehlo","html_url":"https://github.com/baudehlo","followers_url":"https://api.github.com/users/baudehlo/followers","following_url":"https://api.github.com/users/baudehlo/following{/other_user}","gists_url":"https://api.github.com/users/baudehlo/gists{/gist_id}","starred_url":"https://api.github.com/users/baudehlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baudehlo/subscriptions","organizations_url":"https://api.github.com/users/baudehlo/orgs","repos_url":"https://api.github.com/users/baudehlo/repos","events_url":"https://api.github.com/users/baudehlo/events{/privacy}","received_events_url":"https://api.github.com/users/baudehlo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baudehlo/Haraka","description":"An event driven SMTP server","fork":false,"url":"https://api.github.com/repos/baudehlo/Haraka","forks_url":"https://api.github.com/repos/baudehlo/Haraka/forks","keys_url":"https://api.github.com/repos/baudehlo/Haraka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baudehlo/Haraka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baudehlo/Haraka/teams","hooks_url":"https://api.github.com/repos/baudehlo/Haraka/hooks","issue_events_url":"https://api.github.com/repos/baudehlo/Haraka/issues/events{/number}","events_url":"https://api.github.com/repos/baudehlo/Haraka/events","assignees_url":"https://api.github.com/repos/baudehlo/Haraka/assignees{/user}","branches_url":"https://api.github.com/repos/baudehlo/Haraka/branches{/branch}","tags_url":"https://api.github.com/repos/baudehlo/Haraka/tags","blobs_url":"https://api.github.com/repos/baudehlo/Haraka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baudehlo/Haraka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baudehlo/Haraka/git/refs{/sha}","trees_url":"https://api.github.com/repos/baudehlo/Haraka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baudehlo/Haraka/statuses/{sha}","languages_url":"https://api.github.com/repos/baudehlo/Haraka/languages","stargazers_url":"https://api.github.com/repos/baudehlo/Haraka/stargazers","contributors_url":"https://api.github.com/repos/baudehlo/Haraka/contributors","subscribers_url":"https://api.github.com/repos/baudehlo/Haraka/subscribers","subscription_url":"https://api.github.com/repos/baudehlo/Haraka/subscription","commits_url":"https://api.github.com/repos/baudehlo/Haraka/commits{/sha}","git_commits_url":"https://api.github.com/repos/baudehlo/Haraka/git/commits{/sha}","comments_url":"https://api.github.com/repos/baudehlo/Haraka/comments{/number}","issue_comment_url":"https://api.github.com/repos/baudehlo/Haraka/issues/comments{/number}","contents_url":"https://api.github.com/repos/baudehlo/Haraka/contents/{+path}","compare_url":"https://api.github.com/repos/baudehlo/Haraka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baudehlo/Haraka/merges","archive_url":"https://api.github.com/repos/baudehlo/Haraka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baudehlo/Haraka/downloads","issues_url":"https://api.github.com/repos/baudehlo/Haraka/issues{/number}","pulls_url":"https://api.github.com/repos/baudehlo/Haraka/pulls{/number}","milestones_url":"https://api.github.com/repos/baudehlo/Haraka/milestones{/number}","notifications_url":"https://api.github.com/repos/baudehlo/Haraka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baudehlo/Haraka/labels{/name}","releases_url":"https://api.github.com/repos/baudehlo/Haraka/releases{/id}","created_at":"2011-03-10T17:00:20Z","updated_at":"2015-02-24T09:31:11Z","pushed_at":"2015-02-23T21:24:15Z","git_url":"git://github.com/baudehlo/Haraka.git","ssh_url":"git@github.com:baudehlo/Haraka.git","clone_url":"https://github.com/baudehlo/Haraka.git","svn_url":"https://github.com/baudehlo/Haraka","homepage":"http://haraka.github.io/","size":8304,"stargazers_count":1706,"watchers_count":1706,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":47,"forks":189,"open_issues":47,"watchers":1706,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/858"},"html":{"href":"https://github.com/baudehlo/Haraka/pull/858"},"issue":{"href":"https://api.github.com/repos/baudehlo/Haraka/issues/858"},"comments":{"href":"https://api.github.com/repos/baudehlo/Haraka/issues/858/comments"},"review_comments":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/858/comments"},"review_comment":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baudehlo/Haraka/pulls/858/commits"},"statuses":{"href":"https://api.github.com/repos/baudehlo/Haraka/statuses/227ec443d5c268d5b0426a6117c3751cb5645c42"}}}}