Hi!

On Tue, Jan 22, 2013 at 7:01 PM, Guido Trotter <ultrot...@google.com> wrote:

> On Tue, Jan 22, 2013 at 3:55 PM, Helga Velroyen <hel...@google.com> wrote:
> > When creating a network, so far no size constraints were checked.
> > We now limit the size of a network to a /30 or bigger, although
> > tecnically, the ipaddr library supports even /32 networks.
> >
> > Signed-off-by: Helga Velroyen <hel...@google.com>
> > ---
> >  lib/network.py |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/network.py b/lib/network.py
> > index cc3bfd6..d8753d7 100644
> > --- a/lib/network.py
> > +++ b/lib/network.py
> > @@ -29,6 +29,8 @@ from bitarray import bitarray
> >
> >  from ganeti import errors
> >
> > +NETWORK_MIN_SIZE = 30
> > +NETWORK_MIN_NUM_HOSTS = 2 ** (32 - NETWORK_MIN_SIZE)
>
> But shoudln't the NETWORK_MIN_SIZE be derived from
> NETWORK_MIN_NUM_HOSTS and not vice versa?
> In IPv6 for example a /30 has plenty of hosts... Of course in that
> case the "32" would also be protocol dependent.
>

Are you happy if I rename the constants to IPV4_NETWORK_...? :)

Cheers,
Helga

Reply via email to