[Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask
Antoine Pitrou
solipsis at pitrou.net
Thu Mar 12 19:17:17 CET 2015
More information about the Python-Dev mailing list
Thu Mar 12 19:17:17 CET 2015
- Previous message (by thread): [Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask
- Next message (by thread): [Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 12 Mar 2015 14:08:01 -0400 Scott Dial <scott+python-dev at scottdial.com> wrote: > On 2015-03-12 10:46 AM, Eric V. Smith wrote: > > On 3/12/2015 10:00 AM, Antoine Pitrou wrote: > >> Related issue: > >> > >>>>> ipaddress.IPv4Interface('10.0.0.255/8') + 1 > >> IPv4Interface('10.0.1.0/32') > >> > >> Should the result be IPv4Interface('10.0.0.0/8') > >> (i.e. wrap around)? Should OverflowError be raised? > > > > I think it should be an OverflowError. 10.0.1.0/8 makes no sense, and > > 10.0.0.0/8 is unlikely to be desirable. > > > > No, you are both imbuing meaning to the dot-notation that is not there. > A.B.C.D is just an ugly way to represent a single 32-bit unsigned > integer. The only contentious part would be when your addition would > overlfow the host-portion of the address: > > >>> ipaddress.IPv4Interface('10.255.255.255/8') + 1 > IPv4Interface('11.0.0.0/8') Oh, well, you're right, I borked my subnet. So, for the record, I meant "10.0.0.255/24" where the issue actually appears. Regards Antoine.
- Previous message (by thread): [Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask
- Next message (by thread): [Python-Dev] Request for comments: [issue22941] IPv4Interface arithmetic changes subnet mask
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list