Issue 35989: ipaddress.IPv4Network allows prefix > 32
Created on 2019-02-13 16:13 by John Florian, last changed 2022-04-11 14:59 by admin.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11844 | open | matrixise, 2019-02-13 20:45 | |
| Messages (5) | |||
|---|---|---|---|
| msg335460 - (view) | Author: John Florian (John Florian) | Date: 2019-02-13 16:13 | |
I wanted a simple is_valid_ipv4_network() function, so I wrote one and a bunch of unit tests where I discovered that I can legally:
>>> n = IPv4Network(('192.168.123.234', 12345678))
>>> n
IPv4Network('192.168.123.234/12345678')
>>> n.prefixlen
12345678
>>> n.max_prefixlen
32
I assume this is a bug.
|
|||
| msg335475 - (view) | Author: Stéphane Wirtel (matrixise) * ![]() |
Date: 2019-02-13 20:47 | |
I proposed my PR but I prefer a review because in the code of ipaddress, there is a function for the validation of an address with the netmask. Maybe we could use this function and try to refactor/improve the current code. |
|||
| msg337228 - (view) | Author: Rémi Lapeyre (remi.lapeyre) * | Date: 2019-03-05 16:44 | |
Hi @maxtrixise, thanks for PR, > there is a function for the validation of an address with the netmask Which one do you want to use? |
|||
| msg337230 - (view) | Author: James Edwards (jedwards) * | Date: 2019-03-05 16:59 | |
It may be worth also addressing the fact that IPv6Network makes no restriction on it's netmask (when specified as a tuple). |
|||
| msg342795 - (view) | Author: Karthikeyan Singaravelan (xtreak) * ![]() |
Date: 2019-05-18 12:19 | |
See also issue36845 that seems to have fixed this. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:11 | admin | set | github: 80170 |
| 2019-05-18 12:19:37 | xtreak | set | nosy:
+ xtreak messages: + msg342795 |
| 2019-03-05 16:59:48 | jedwards | set | nosy:
+ jedwards messages: + msg337230 |
| 2019-03-05 16:44:02 | remi.lapeyre | set | messages: + msg337228 |
| 2019-02-13 20:47:15 | matrixise | set | nosy:
+ matrixise messages: + msg335475 |
| 2019-02-13 20:45:06 | matrixise | set | keywords:
+ patch stage: test needed -> patch review pull_requests: + pull_request11875 |
| 2019-02-13 17:06:13 | SilentGhost | set | nosy:
+ pitrou type: behavior |
| 2019-02-13 16:14:52 | remi.lapeyre | set | nosy:
+ remi.lapeyre |
| 2019-02-13 16:13:55 | John Florian | create | |
