{"action":"created","comment":{"url":"https://api.github.com/repos/romana/core/pulls/comments/54620614","id":54620614,"diff_hunk":"@@ -30,7 +30,14 @@ func MakeIPv4(a, b, c, d byte) IP {\n }\n \n func IPv4ToInt(ip net.IP) uint64 {\n-\treturn uint64(ip[12])<<24 | uint64(ip[13])<<16 | uint64(ip[14])<<8 | uint64(ip[15])\n+\tswitch len(ip) {\n+\tcase 4: // IPv4","path":"common/structures.go","position":6,"original_position":6,"commit_id":"1de17cd482515660e0d6f47dac20257b698dce4e","original_commit_id":"1de17cd482515660e0d6f47dac20257b698dce4e","user":{"login":"debedb","id":619943,"avatar_url":"https://avatars.githubusercontent.com/u/619943?v=3","gravatar_id":"","url":"https://api.github.com/users/debedb","html_url":"https://github.com/debedb","followers_url":"https://api.github.com/users/debedb/followers","following_url":"https://api.github.com/users/debedb/following{/other_user}","gists_url":"https://api.github.com/users/debedb/gists{/gist_id}","starred_url":"https://api.github.com/users/debedb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debedb/subscriptions","organizations_url":"https://api.github.com/users/debedb/orgs","repos_url":"https://api.github.com/users/debedb/repos","events_url":"https://api.github.com/users/debedb/events{/privacy}","received_events_url":"https://api.github.com/users/debedb/received_events","type":"User","site_admin":false},"body":"Then name shoudl be really IPToInt","created_at":"2016-03-01T19:26:32Z","updated_at":"2016-03-01T19:26:32Z","html_url":"https://github.com/romana/core/pull/42#discussion_r54620614","pull_request_url":"https://api.github.com/repos/romana/core/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/romana/core/pulls/comments/54620614"},"html":{"href":"https://github.com/romana/core/pull/42#discussion_r54620614"},"pull_request":{"href":"https://api.github.com/repos/romana/core/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/romana/core/pulls/42","id":60609578,"html_url":"https://github.com/romana/core/pull/42","diff_url":"https://github.com/romana/core/pull/42.diff","patch_url":"https://github.com/romana/core/pull/42.patch","issue_url":"https://api.github.com/repos/romana/core/issues/42","number":42,"state":"open","locked":false,"title":"Allocate address using network IP instead of plain IP from CIDR","user":{"login":"cgilmour","id":892558,"avatar_url":"https://avatars.githubusercontent.com/u/892558?v=3","gravatar_id":"","url":"https://api.github.com/users/cgilmour","html_url":"https://github.com/cgilmour","followers_url":"https://api.github.com/users/cgilmour/followers","following_url":"https://api.github.com/users/cgilmour/following{/other_user}","gists_url":"https://api.github.com/users/cgilmour/gists{/gist_id}","starred_url":"https://api.github.com/users/cgilmour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgilmour/subscriptions","organizations_url":"https://api.github.com/users/cgilmour/orgs","repos_url":"https://api.github.com/users/cgilmour/repos","events_url":"https://api.github.com/users/cgilmour/events{/privacy}","received_events_url":"https://api.github.com/users/cgilmour/received_events","type":"User","site_admin":false},"body":"Before: romana_ip needs to be configured as network address (10.1.0.**0**/16) instead of IP and mask (10.1.0.**1**/16)\r\nUsing a .1 address in this config would make IPAM allocate only even addresses. (It would take the full address 10.1.0.**1** and add tenant/segment bits, instead of taking the network address 10.1.0.**0**).\r\nAfter: always calculate off network address.\r\n\r\nImpact: k8s-listener is using romana_ip when it detects a new policy and tries to send instructions to the listener-agent to create rules.","created_at":"2016-02-25T01:23:25Z","updated_at":"2016-03-01T19:26:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"889eaf364f0900dabcd2e15074d327da99465707","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/romana/core/pulls/42/commits","review_comments_url":"https://api.github.com/repos/romana/core/pulls/42/comments","review_comment_url":"https://api.github.com/repos/romana/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/romana/core/issues/42/comments","statuses_url":"https://api.github.com/repos/romana/core/statuses/1de17cd482515660e0d6f47dac20257b698dce4e","head":{"label":"romana:bug/ipam-romana-ip","ref":"bug/ipam-romana-ip","sha":"1de17cd482515660e0d6f47dac20257b698dce4e","user":{"login":"romana","id":9849297,"avatar_url":"https://avatars.githubusercontent.com/u/9849297?v=3","gravatar_id":"","url":"https://api.github.com/users/romana","html_url":"https://github.com/romana","followers_url":"https://api.github.com/users/romana/followers","following_url":"https://api.github.com/users/romana/following{/other_user}","gists_url":"https://api.github.com/users/romana/gists{/gist_id}","starred_url":"https://api.github.com/users/romana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romana/subscriptions","organizations_url":"https://api.github.com/users/romana/orgs","repos_url":"https://api.github.com/users/romana/repos","events_url":"https://api.github.com/users/romana/events{/privacy}","received_events_url":"https://api.github.com/users/romana/received_events","type":"Organization","site_admin":false},"repo":{"id":43855674,"name":"core","full_name":"romana/core","owner":{"login":"romana","id":9849297,"avatar_url":"https://avatars.githubusercontent.com/u/9849297?v=3","gravatar_id":"","url":"https://api.github.com/users/romana","html_url":"https://github.com/romana","followers_url":"https://api.github.com/users/romana/followers","following_url":"https://api.github.com/users/romana/following{/other_user}","gists_url":"https://api.github.com/users/romana/gists{/gist_id}","starred_url":"https://api.github.com/users/romana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romana/subscriptions","organizations_url":"https://api.github.com/users/romana/orgs","repos_url":"https://api.github.com/users/romana/repos","events_url":"https://api.github.com/users/romana/events{/privacy}","received_events_url":"https://api.github.com/users/romana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/romana/core","description":"Romana core components - Micro services written in Go.","fork":false,"url":"https://api.github.com/repos/romana/core","forks_url":"https://api.github.com/repos/romana/core/forks","keys_url":"https://api.github.com/repos/romana/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romana/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romana/core/teams","hooks_url":"https://api.github.com/repos/romana/core/hooks","issue_events_url":"https://api.github.com/repos/romana/core/issues/events{/number}","events_url":"https://api.github.com/repos/romana/core/events","assignees_url":"https://api.github.com/repos/romana/core/assignees{/user}","branches_url":"https://api.github.com/repos/romana/core/branches{/branch}","tags_url":"https://api.github.com/repos/romana/core/tags","blobs_url":"https://api.github.com/repos/romana/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romana/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romana/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/romana/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romana/core/statuses/{sha}","languages_url":"https://api.github.com/repos/romana/core/languages","stargazers_url":"https://api.github.com/repos/romana/core/stargazers","contributors_url":"https://api.github.com/repos/romana/core/contributors","subscribers_url":"https://api.github.com/repos/romana/core/subscribers","subscription_url":"https://api.github.com/repos/romana/core/subscription","commits_url":"https://api.github.com/repos/romana/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/romana/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/romana/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/romana/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/romana/core/contents/{+path}","compare_url":"https://api.github.com/repos/romana/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romana/core/merges","archive_url":"https://api.github.com/repos/romana/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romana/core/downloads","issues_url":"https://api.github.com/repos/romana/core/issues{/number}","pulls_url":"https://api.github.com/repos/romana/core/pulls{/number}","milestones_url":"https://api.github.com/repos/romana/core/milestones{/number}","notifications_url":"https://api.github.com/repos/romana/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romana/core/labels{/name}","releases_url":"https://api.github.com/repos/romana/core/releases{/id}","deployments_url":"https://api.github.com/repos/romana/core/deployments","created_at":"2015-10-08T01:45:35Z","updated_at":"2016-02-19T21:14:02Z","pushed_at":"2016-03-01T18:59:29Z","git_url":"git://github.com/romana/core.git","ssh_url":"git@github.com:romana/core.git","clone_url":"https://github.com/romana/core.git","svn_url":"https://github.com/romana/core","homepage":"","size":322,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":3,"default_branch":"master"}},"base":{"label":"romana:master","ref":"master","sha":"044ec132877d910e3d4b899f38df1038f0452a29","user":{"login":"romana","id":9849297,"avatar_url":"https://avatars.githubusercontent.com/u/9849297?v=3","gravatar_id":"","url":"https://api.github.com/users/romana","html_url":"https://github.com/romana","followers_url":"https://api.github.com/users/romana/followers","following_url":"https://api.github.com/users/romana/following{/other_user}","gists_url":"https://api.github.com/users/romana/gists{/gist_id}","starred_url":"https://api.github.com/users/romana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romana/subscriptions","organizations_url":"https://api.github.com/users/romana/orgs","repos_url":"https://api.github.com/users/romana/repos","events_url":"https://api.github.com/users/romana/events{/privacy}","received_events_url":"https://api.github.com/users/romana/received_events","type":"Organization","site_admin":false},"repo":{"id":43855674,"name":"core","full_name":"romana/core","owner":{"login":"romana","id":9849297,"avatar_url":"https://avatars.githubusercontent.com/u/9849297?v=3","gravatar_id":"","url":"https://api.github.com/users/romana","html_url":"https://github.com/romana","followers_url":"https://api.github.com/users/romana/followers","following_url":"https://api.github.com/users/romana/following{/other_user}","gists_url":"https://api.github.com/users/romana/gists{/gist_id}","starred_url":"https://api.github.com/users/romana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romana/subscriptions","organizations_url":"https://api.github.com/users/romana/orgs","repos_url":"https://api.github.com/users/romana/repos","events_url":"https://api.github.com/users/romana/events{/privacy}","received_events_url":"https://api.github.com/users/romana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/romana/core","description":"Romana core components - Micro services written in Go.","fork":false,"url":"https://api.github.com/repos/romana/core","forks_url":"https://api.github.com/repos/romana/core/forks","keys_url":"https://api.github.com/repos/romana/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romana/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romana/core/teams","hooks_url":"https://api.github.com/repos/romana/core/hooks","issue_events_url":"https://api.github.com/repos/romana/core/issues/events{/number}","events_url":"https://api.github.com/repos/romana/core/events","assignees_url":"https://api.github.com/repos/romana/core/assignees{/user}","branches_url":"https://api.github.com/repos/romana/core/branches{/branch}","tags_url":"https://api.github.com/repos/romana/core/tags","blobs_url":"https://api.github.com/repos/romana/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romana/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romana/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/romana/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romana/core/statuses/{sha}","languages_url":"https://api.github.com/repos/romana/core/languages","stargazers_url":"https://api.github.com/repos/romana/core/stargazers","contributors_url":"https://api.github.com/repos/romana/core/contributors","subscribers_url":"https://api.github.com/repos/romana/core/subscribers","subscription_url":"https://api.github.com/repos/romana/core/subscription","commits_url":"https://api.github.com/repos/romana/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/romana/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/romana/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/romana/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/romana/core/contents/{+path}","compare_url":"https://api.github.com/repos/romana/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romana/core/merges","archive_url":"https://api.github.com/repos/romana/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romana/core/downloads","issues_url":"https://api.github.com/repos/romana/core/issues{/number}","pulls_url":"https://api.github.com/repos/romana/core/pulls{/number}","milestones_url":"https://api.github.com/repos/romana/core/milestones{/number}","notifications_url":"https://api.github.com/repos/romana/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romana/core/labels{/name}","releases_url":"https://api.github.com/repos/romana/core/releases{/id}","deployments_url":"https://api.github.com/repos/romana/core/deployments","created_at":"2015-10-08T01:45:35Z","updated_at":"2016-02-19T21:14:02Z","pushed_at":"2016-03-01T18:59:29Z","git_url":"git://github.com/romana/core.git","ssh_url":"git@github.com:romana/core.git","clone_url":"https://github.com/romana/core.git","svn_url":"https://github.com/romana/core","homepage":"","size":322,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/romana/core/pulls/42"},"html":{"href":"https://github.com/romana/core/pull/42"},"issue":{"href":"https://api.github.com/repos/romana/core/issues/42"},"comments":{"href":"https://api.github.com/repos/romana/core/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/romana/core/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/romana/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/romana/core/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/romana/core/statuses/1de17cd482515660e0d6f47dac20257b698dce4e"}}}}