Skip to content

iptools.ipv4.validate_netmask() seems to be auto-filling 0's #18

Description

@DarthOpto

import iptools netmask = '255' valid = iptools.ipv4.validate_netmask(netmask)
This 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.

Also, we tried inputting '0.255.255.0' and this method returned True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions