Re: [HACKERS] inet data type regression test fails - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: [HACKERS] inet data type regression test fails
Date
Msg-id 199905111013.TAA04201@srapc451.sra.co.jp
Whole thread Raw
In response to Re: [HACKERS] inet data type regression test fails  (Taral <taral@taral.net>)
List pgsql-hackers
>> >>         unsigned long mask = 0xffffffff;
>> >> 
>> >>         if (ip_bits(ip) < 32)
>> >>             mask >>= ip_bits(ip);
>> >>         addr = htonl(ntohl(ip_v4addr(ip)) | mask);
>
>> No. it is expected addr == 0xffffffff if ip_bits() returns >= 32. This 
>> is how the function (network_broadcast()) is made.
>> See included posting.
>
>ip_bits(ip) = 0  => mask = 0xffffffff
>ip_bits(ip) = 31 => mask = 1
>ip_bits(ip) = 32 => mask = 0xffffffff
>
>You sure?

Yes. That's exactly what I expected.
---
Tatsuo Ishii



pgsql-hackers by date:

Previous
From: gjerde@icebox.org
Date:
Subject: Re: [HACKERS] problem compiling 6.5 cvs (Linux, gcc 2.7.2, egcs 1.12)
Next
From: Chris Bitmead
Date:
Subject: Re: [HACKERS] Date/Time Flaw in pg_dump ?