Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect response when using 'is_netmask` with inverse netmask. #548

Open
jdrew82 opened this issue Jul 12, 2024 · 1 comment
Open

Incorrect response when using 'is_netmask` with inverse netmask. #548

jdrew82 opened this issue Jul 12, 2024 · 1 comment

Comments

@jdrew82
Copy link
Contributor

jdrew82 commented Jul 12, 2024

Environment

  • Python version: 3.11
  • netutils version: 1.9.0

Expected Behavior

Expected to get a True response when passing "0.31.255.255" to is_netmask().

Observed Behavior

It was returned as False:

In [1]: from netutils.ip import is_netmask

In [2]: is_netmask("0.31.255.255")
Out[2]: False

Steps to Reproduce

  1. Import is_netmask() in REPL.
  2. Pass inverse/wildcard netmasks to the is_netmask().
  3. See results.
@jdrew82
Copy link
Contributor Author

jdrew82 commented Jul 12, 2024

This also means the netmask_to_cidr() function doesn't work as the is_netmask() returns False. If you test what's returned with that function ignoring the is_netmask() check you get the CIDR returned when using an inverse netmask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant