{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments/53303484","id":53303484,"diff_hunk":"@@ -87,15 +97,24 @@ def report msg, response, error_only\n       raise Proxy::Dns::Error.new(\"Unknown error while processing '#{msg}'\")\n     end\n \n-    def match_zone(fqdn)\n+    def match_zone(fqdn_or_ip)\n       dns_zones = enum_zones\n       weight = 0 # sub zones might be independent from similar named parent zones; use weight for longest suffix match\n       matched_zone = nil\n+      ip_check = validate_ip6(fqdn_or_ip)","path":"modules/dns_dnscmd/dns_dnscmd_main.rb","position":55,"original_position":55,"commit_id":"9343c65747e675a24564ce6d6dacf6f5354093ec","original_commit_id":"9343c65747e675a24564ce6d6dacf6f5354093ec","user":{"login":"witlessbird","id":8957,"avatar_url":"https://avatars.githubusercontent.com/u/8957?v=3","gravatar_id":"","url":"https://api.github.com/users/witlessbird","html_url":"https://github.com/witlessbird","followers_url":"https://api.github.com/users/witlessbird/followers","following_url":"https://api.github.com/users/witlessbird/following{/other_user}","gists_url":"https://api.github.com/users/witlessbird/gists{/gist_id}","starred_url":"https://api.github.com/users/witlessbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witlessbird/subscriptions","organizations_url":"https://api.github.com/users/witlessbird/orgs","repos_url":"https://api.github.com/users/witlessbird/repos","events_url":"https://api.github.com/users/witlessbird/events{/privacy}","received_events_url":"https://api.github.com/users/witlessbird/received_events","type":"User","site_admin":false},"body":"what happens when an address is ipv4?","created_at":"2016-02-18T11:43:29Z","updated_at":"2016-02-18T11:43:29Z","html_url":"https://github.com/theforeman/smart-proxy/pull/379#discussion_r53303484","pull_request_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379","_links":{"self":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments/53303484"},"html":{"href":"https://github.com/theforeman/smart-proxy/pull/379#discussion_r53303484"},"pull_request":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379","id":59567141,"html_url":"https://github.com/theforeman/smart-proxy/pull/379","diff_url":"https://github.com/theforeman/smart-proxy/pull/379.diff","patch_url":"https://github.com/theforeman/smart-proxy/pull/379.patch","issue_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/379","number":379,"state":"open","locked":false,"title":"Fixes #13536 - working ptr's for dnscmd","user":{"login":"helge000","id":13696924,"avatar_url":"https://avatars.githubusercontent.com/u/13696924?v=3","gravatar_id":"","url":"https://api.github.com/users/helge000","html_url":"https://github.com/helge000","followers_url":"https://api.github.com/users/helge000/followers","following_url":"https://api.github.com/users/helge000/following{/other_user}","gists_url":"https://api.github.com/users/helge000/gists{/gist_id}","starred_url":"https://api.github.com/users/helge000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helge000/subscriptions","organizations_url":"https://api.github.com/users/helge000/orgs","repos_url":"https://api.github.com/users/helge000/repos","events_url":"https://api.github.com/users/helge000/events{/privacy}","received_events_url":"https://api.github.com/users/helge000/received_events","type":"User","site_admin":false},"body":"Makes PTR's for dnscmd working again.\r\n\r\n~~Sadly~~ I had to introduce a ~~rather complicated~~ method `#get_ptr_record` ~~because dnscmd's rather strange implementation of adding pointers~~. It should also handle IPv6 reverse zones, see tests.\r\n\r\nIt executes dnscmd in the following manner:\r\n\r\nEg for host `host.foo.bar.domain.local.` with `192.168.33.2` and a given /16 reverse zone `168.192.in-addr.arpa`:\r\n\r\n#### IPv4\r\n```\r\ndnscmd /RecordAdd 168.192.in-addr.arpa 2.33.168.192.in-addr.arpa. PTR host.foo.bar.domain.local.\r\n```\r\n\r\n#### IPv6\r\n```\r\ndnscmd /RecordAdd f.e.e.d.8.b.d.0.1.0.0.2.ip6.arpa 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.f.e.e.d.8.b.d.0.1.0.0.2.ip6.arpa. PTR host.foo.bar.domain.local.\r\n```\r\n\r\n~~**Note:** This further fixes a rubocop offense introduced with overlapping #369 and #373 merges (it seems)~~","created_at":"2016-02-16T22:44:09Z","updated_at":"2016-02-18T11:43:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09e20b23c04a16c5f8454b4d9300a13db782f950","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379/commits","review_comments_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379/comments","review_comment_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/379/comments","statuses_url":"https://api.github.com/repos/theforeman/smart-proxy/statuses/9343c65747e675a24564ce6d6dacf6f5354093ec","head":{"label":"helge000:13536_fix_dnscmd_ptr","ref":"13536_fix_dnscmd_ptr","sha":"9343c65747e675a24564ce6d6dacf6f5354093ec","user":{"login":"helge000","id":13696924,"avatar_url":"https://avatars.githubusercontent.com/u/13696924?v=3","gravatar_id":"","url":"https://api.github.com/users/helge000","html_url":"https://github.com/helge000","followers_url":"https://api.github.com/users/helge000/followers","following_url":"https://api.github.com/users/helge000/following{/other_user}","gists_url":"https://api.github.com/users/helge000/gists{/gist_id}","starred_url":"https://api.github.com/users/helge000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helge000/subscriptions","organizations_url":"https://api.github.com/users/helge000/orgs","repos_url":"https://api.github.com/users/helge000/repos","events_url":"https://api.github.com/users/helge000/events{/privacy}","received_events_url":"https://api.github.com/users/helge000/received_events","type":"User","site_admin":false},"repo":{"id":42310881,"name":"smart-proxy","full_name":"helge000/smart-proxy","owner":{"login":"helge000","id":13696924,"avatar_url":"https://avatars.githubusercontent.com/u/13696924?v=3","gravatar_id":"","url":"https://api.github.com/users/helge000","html_url":"https://github.com/helge000","followers_url":"https://api.github.com/users/helge000/followers","following_url":"https://api.github.com/users/helge000/following{/other_user}","gists_url":"https://api.github.com/users/helge000/gists{/gist_id}","starred_url":"https://api.github.com/users/helge000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helge000/subscriptions","organizations_url":"https://api.github.com/users/helge000/orgs","repos_url":"https://api.github.com/users/helge000/repos","events_url":"https://api.github.com/users/helge000/events{/privacy}","received_events_url":"https://api.github.com/users/helge000/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/helge000/smart-proxy","description":"RESTful proxies for DNS, DHCP, TFTP, BMC and Puppet","fork":true,"url":"https://api.github.com/repos/helge000/smart-proxy","forks_url":"https://api.github.com/repos/helge000/smart-proxy/forks","keys_url":"https://api.github.com/repos/helge000/smart-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helge000/smart-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helge000/smart-proxy/teams","hooks_url":"https://api.github.com/repos/helge000/smart-proxy/hooks","issue_events_url":"https://api.github.com/repos/helge000/smart-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/helge000/smart-proxy/events","assignees_url":"https://api.github.com/repos/helge000/smart-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/helge000/smart-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/helge000/smart-proxy/tags","blobs_url":"https://api.github.com/repos/helge000/smart-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helge000/smart-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helge000/smart-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/helge000/smart-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helge000/smart-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/helge000/smart-proxy/languages","stargazers_url":"https://api.github.com/repos/helge000/smart-proxy/stargazers","contributors_url":"https://api.github.com/repos/helge000/smart-proxy/contributors","subscribers_url":"https://api.github.com/repos/helge000/smart-proxy/subscribers","subscription_url":"https://api.github.com/repos/helge000/smart-proxy/subscription","commits_url":"https://api.github.com/repos/helge000/smart-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/helge000/smart-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/helge000/smart-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/helge000/smart-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/helge000/smart-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/helge000/smart-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helge000/smart-proxy/merges","archive_url":"https://api.github.com/repos/helge000/smart-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helge000/smart-proxy/downloads","issues_url":"https://api.github.com/repos/helge000/smart-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/helge000/smart-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/helge000/smart-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/helge000/smart-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helge000/smart-proxy/labels{/name}","releases_url":"https://api.github.com/repos/helge000/smart-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/helge000/smart-proxy/deployments","created_at":"2015-09-11T13:44:31Z","updated_at":"2015-09-11T13:44:32Z","pushed_at":"2016-02-18T10:43:29Z","git_url":"git://github.com/helge000/smart-proxy.git","ssh_url":"git@github.com:helge000/smart-proxy.git","clone_url":"https://github.com/helge000/smart-proxy.git","svn_url":"https://github.com/helge000/smart-proxy","homepage":"http://theforeman.org/projects/smart-proxy","size":1171,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"theforeman:develop","ref":"develop","sha":"5f5c21683ed32f5281ed018800b36a03552ae3ca","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":986551,"name":"smart-proxy","full_name":"theforeman/smart-proxy","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/smart-proxy","description":"RESTful proxies for DNS, DHCP, TFTP, BMC and Puppet","fork":false,"url":"https://api.github.com/repos/theforeman/smart-proxy","forks_url":"https://api.github.com/repos/theforeman/smart-proxy/forks","keys_url":"https://api.github.com/repos/theforeman/smart-proxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/smart-proxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/smart-proxy/teams","hooks_url":"https://api.github.com/repos/theforeman/smart-proxy/hooks","issue_events_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/smart-proxy/events","assignees_url":"https://api.github.com/repos/theforeman/smart-proxy/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/smart-proxy/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/smart-proxy/tags","blobs_url":"https://api.github.com/repos/theforeman/smart-proxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/smart-proxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/smart-proxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/smart-proxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/smart-proxy/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/smart-proxy/languages","stargazers_url":"https://api.github.com/repos/theforeman/smart-proxy/stargazers","contributors_url":"https://api.github.com/repos/theforeman/smart-proxy/contributors","subscribers_url":"https://api.github.com/repos/theforeman/smart-proxy/subscribers","subscription_url":"https://api.github.com/repos/theforeman/smart-proxy/subscription","commits_url":"https://api.github.com/repos/theforeman/smart-proxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/smart-proxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/smart-proxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/smart-proxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/smart-proxy/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/smart-proxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/smart-proxy/merges","archive_url":"https://api.github.com/repos/theforeman/smart-proxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/smart-proxy/downloads","issues_url":"https://api.github.com/repos/theforeman/smart-proxy/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/smart-proxy/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/smart-proxy/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/smart-proxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/smart-proxy/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/smart-proxy/releases{/id}","deployments_url":"https://api.github.com/repos/theforeman/smart-proxy/deployments","created_at":"2010-10-14T10:00:51Z","updated_at":"2016-02-16T10:56:46Z","pushed_at":"2016-02-18T11:29:07Z","git_url":"git://github.com/theforeman/smart-proxy.git","ssh_url":"git@github.com:theforeman/smart-proxy.git","clone_url":"https://github.com/theforeman/smart-proxy.git","svn_url":"https://github.com/theforeman/smart-proxy","homepage":"http://theforeman.org/projects/smart-proxy","size":1791,"stargazers_count":124,"watchers_count":124,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":147,"mirror_url":null,"open_issues_count":21,"forks":147,"open_issues":21,"watchers":124,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379"},"html":{"href":"https://github.com/theforeman/smart-proxy/pull/379"},"issue":{"href":"https://api.github.com/repos/theforeman/smart-proxy/issues/379"},"comments":{"href":"https://api.github.com/repos/theforeman/smart-proxy/issues/379/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/smart-proxy/pulls/379/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/smart-proxy/statuses/9343c65747e675a24564ce6d6dacf6f5354093ec"}}}}