{"action":"created","issue":{"url":"https://api.github.com/repos/bd808/python-iptools/issues/18","repository_url":"https://api.github.com/repos/bd808/python-iptools","labels_url":"https://api.github.com/repos/bd808/python-iptools/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/bd808/python-iptools/issues/18/comments","events_url":"https://api.github.com/repos/bd808/python-iptools/issues/18/events","html_url":"https://github.com/bd808/python-iptools/issues/18","id":171768630,"number":18,"title":"iptools.ipv4.validate_netmask() seems to be auto-filling 0's","user":{"login":"DarthOpto","id":7504395,"avatar_url":"https://avatars.githubusercontent.com/u/7504395?v=3","gravatar_id":"","url":"https://api.github.com/users/DarthOpto","html_url":"https://github.com/DarthOpto","followers_url":"https://api.github.com/users/DarthOpto/followers","following_url":"https://api.github.com/users/DarthOpto/following{/other_user}","gists_url":"https://api.github.com/users/DarthOpto/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthOpto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthOpto/subscriptions","organizations_url":"https://api.github.com/users/DarthOpto/orgs","repos_url":"https://api.github.com/users/DarthOpto/repos","events_url":"https://api.github.com/users/DarthOpto/events{/privacy}","received_events_url":"https://api.github.com/users/DarthOpto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bd808/python-iptools/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-17T21:47:51Z","updated_at":"2016-08-24T14:27:21Z","closed_at":null,"body":"`import iptools\r\nnetmask = '255'\r\nvalid = iptools.ipv4.validate_netmask(netmask)\r\n`\r\nThis returns `True`.  255 is not a valid netmask. It seems that this is auto-filling the 0's to make it a full netmask. We were using this tool to check and see if our users are entering valid IP addresses, netmasks, and gateways. Since it is auto-filling if you only have the first octet and nothing else this is not a valid tool which we can use. \r\n\r\nAlso, we tried inputting '0.255.255.0' and this method returned True. "},"comment":{"url":"https://api.github.com/repos/bd808/python-iptools/issues/comments/242084176","html_url":"https://github.com/bd808/python-iptools/issues/18#issuecomment-242084176","issue_url":"https://api.github.com/repos/bd808/python-iptools/issues/18","id":242084176,"user":{"login":"DarthOpto","id":7504395,"avatar_url":"https://avatars.githubusercontent.com/u/7504395?v=3","gravatar_id":"","url":"https://api.github.com/users/DarthOpto","html_url":"https://github.com/DarthOpto","followers_url":"https://api.github.com/users/DarthOpto/followers","following_url":"https://api.github.com/users/DarthOpto/following{/other_user}","gists_url":"https://api.github.com/users/DarthOpto/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthOpto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthOpto/subscriptions","organizations_url":"https://api.github.com/users/DarthOpto/orgs","repos_url":"https://api.github.com/users/DarthOpto/repos","events_url":"https://api.github.com/users/DarthOpto/events{/privacy}","received_events_url":"https://api.github.com/users/DarthOpto/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T14:27:21Z","updated_at":"2016-08-24T14:27:21Z","body":"We **were** using iptools for validating user input into a system as it was being setup to make sure that they were entering in a valid netmask. If the user does not enter in a valid netmask their system will have to be reconfigured. Our hope was that iptools would validate that the user had entered in a correct netmask. It does not. By auto-filling with 0's we cannot accurately validate whether or not a user has \"fat-fingered\" and possibly made a mistake when entering their netmask. \r\n\r\n255 may be a valid value for short-hand notation, however simply checking whether or not the value entered is a valid netmask would seem to me to be better suited to not having it auto-fill with zeros. "}}
{"actor":{"display_login":"DarthOpto"}}