{"action":"closed","issue":{"url":"https://api.github.com/repos/drkjam/netaddr/issues/95","labels_url":"https://api.github.com/repos/drkjam/netaddr/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/drkjam/netaddr/issues/95/comments","events_url":"https://api.github.com/repos/drkjam/netaddr/issues/95/events","html_url":"https://github.com/drkjam/netaddr/issues/95","id":88517841,"number":95,"title":"Inconsistent Address Handling in IPSet","user":{"login":"mjaustin2","id":12900658,"avatar_url":"https://avatars.githubusercontent.com/u/12900658?v=3","gravatar_id":"","url":"https://api.github.com/users/mjaustin2","html_url":"https://github.com/mjaustin2","followers_url":"https://api.github.com/users/mjaustin2/followers","following_url":"https://api.github.com/users/mjaustin2/following{/other_user}","gists_url":"https://api.github.com/users/mjaustin2/gists{/gist_id}","starred_url":"https://api.github.com/users/mjaustin2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjaustin2/subscriptions","organizations_url":"https://api.github.com/users/mjaustin2/orgs","repos_url":"https://api.github.com/users/mjaustin2/repos","events_url":"https://api.github.com/users/mjaustin2/events{/privacy}","received_events_url":"https://api.github.com/users/mjaustin2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/drkjam/netaddr/milestones/5","html_url":"https://github.com/drkjam/netaddr/milestones/0.7.15","labels_url":"https://api.github.com/repos/drkjam/netaddr/milestones/5/labels","id":1156625,"number":5,"title":"0.7.15","description":null,"creator":{"login":"snordhausen","id":1327310,"avatar_url":"https://avatars.githubusercontent.com/u/1327310?v=3","gravatar_id":"","url":"https://api.github.com/users/snordhausen","html_url":"https://github.com/snordhausen","followers_url":"https://api.github.com/users/snordhausen/followers","following_url":"https://api.github.com/users/snordhausen/following{/other_user}","gists_url":"https://api.github.com/users/snordhausen/gists{/gist_id}","starred_url":"https://api.github.com/users/snordhausen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snordhausen/subscriptions","organizations_url":"https://api.github.com/users/snordhausen/orgs","repos_url":"https://api.github.com/users/snordhausen/repos","events_url":"https://api.github.com/users/snordhausen/events{/privacy}","received_events_url":"https://api.github.com/users/snordhausen/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":2,"state":"open","created_at":"2015-06-09T11:01:17Z","updated_at":"2015-06-19T12:10:40Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-06-15T19:31:54Z","updated_at":"2015-06-19T12:10:40Z","closed_at":"2015-06-19T12:10:40Z","body":"When a list of addresses is passed to IPSet, if that list contains host addresses with a CIDR mask and those items have adjacent networks, even if they are unmergable, the address spaces are changed to their correct network number and CIDR. Otherwise, they remain in the system in their original representation.\r\n\r\n \r\n\r\n```\r\nPython 2.7.9 (default, Apr 22 2015, 00:08:15)\r\n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.49)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import netaddr\r\n>>> print netaddr.__version__\r\n0.7.14\r\n>>> networks = ['10.9.8.6/8', '172.16.1.2/16', '172.18.1.2/24', '192.168.0.0/24','192.168.2.3/23']\r\n>>> set = netaddr.IPSet(networks)\r\n>>> print set\r\nIPSet(['10.9.8.6/8', '172.16.1.2/16', '172.18.1.2/24', '192.168.0.0/24', '192.168.2.3/23'])\r\n>>> for i in set.iter_cidrs():\r\n...     print i\r\n...\r\n10.9.8.6/8     <~~ Nothing adjacent so representation is unchanged.\r\n172.16.1.2/16  <~~ Nothing adjacent so representation is unchanged.\r\n172.18.1.2/24  <~~ Nothing adjacent so representation is unchanged.\r\n192.168.0.0/24 <~~ Nothing to change\r\n192.168.2.3/23 <~~ Nothing adjacent so representation is unchanged.\r\n\r\n>>> networks = ['10.9.6.7/8', '11.0.0.1/8','172.0.0.9/16','172.1.1.1/16','192.168.1.2/24', '192.168.2.3/24']\r\n>>> set = netaddr.IPSet(networks)\r\n>>> print set\r\nIPSet(['10.0.0.0/7', '172.0.0.0/15', '192.168.1.0/24', '192.168.2.0/24'])\r\n>>> for i in set.iter_cidrs():\r\n...     print i\r\n...\r\n10.0.0.0/7     <~~ Merged down to only address space\r\n172.0.0.0/15   <~~ Merged down to only address space\r\n192.168.1.0/24 <~~ Adjacent to another network space, so representation becomes network\r\n192.168.2.0/24 <~~ Adjacent to another network space, so representation becomes network\r\n```"}}