Re: [BUGS] Bug in create operator and/or initdb - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [BUGS] Bug in create operator and/or initdb
Date
Msg-id 87acqpqtlt.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: [BUGS] Bug in create operator and/or initdb  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

>  steve=# select '224.0.0.0'::cidr;
>       cidr     
>   -------------
>    224.0.0.0/4
> 
> which should be /32 according to what the docs say:

224-239 are multicast addresses. Making it /4 makes the entire multicast
address space one network block which is about as reasonable an answer as
anything else.

>         if (bits >= 8 && bits < ((dst - odst) * 8))
>             ^^^^^^^^^
>             bits = (dst - odst) * 8;
>     }
> 
> I think the test for "bits >= 8" should be removed.  Does anyone know
> why it's there?

I guess Vixie figured network blocks subdividing multicast address space
weren't a sensible concept? It's a bit of a strange constraint to hard code
into the C code though.

Incidentally, how can that code possibly work? It treats odst as a pointer in
some places but then calculates bits using arithmetic on it directly without
dereferencing?

-- 
greg



pgsql-hackers by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: Group-count estimation statistics
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] Bug in create operator and/or initdb