Re: [HACKERS] inet data type regression test fails

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: Taral <taral(at)taral(dot)net>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] inet data type regression test fails
Date: 1999-05-11 10:13:59
Message-ID: 199905111013.TAA04201@srapc451.sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 1999-05-11 11:19:41 Re: [HACKERS] Date/Time Flaw in pg_dump ?
Previous Message Oleg Bartunov 1999-05-11 10:01:40 Re: [HACKERS] problem compiling 6.5 cvs (Linux, gcc 2.7.2, egcs 1.12)