Skip site navigation (1) Skip section navigation (2)

classful cidr insertion bug?

From: Paul Schultz <pschultz(at)pschultz(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: classful cidr insertion bug?
Date: 2002-06-17 00:35:22
Message-ID: Pine.LNX.4.44.0206162014160.3821-100000@elvis.kravshera.net (view raw or flat)
Thread:
Lists: pgsql-bugs
I'm running into an issue that contradicts how pgsql should behave
according to the documentation.  Running 7.2.1 .deb package.

For the cidr data type it says an insertion missing the subnet bits should
be handled like legacy classful networks.  ie if I insert just
'172.16.0.0' it should be handled as '172.16.0.0/16'.  I'm seeing it get
inserted as '172.16.0.0/32'.

If i insert using for example '172.16' it works and inserts as a /16, so
does classful insertion only work when inputting with an abbreviated
network (and why the choice to have it restricted like that)?  The data
being stored is essentially a selective parsing of an  entire BGP table
from a Cisco router, so legacy class a/b/c space with  8/16/24 bit
netmasks respectively show up without the prefix length bits.


niara=# \d prefixes
                                     Table "prefixes"
  Column   |          Type          |                      Modifiers
-----------+------------------------+-----------------------------------------------------
 prefix    | cidr                   |
 aspath    | character varying(200) |
 origin_as | integer                |
 id        | integer                | not null default
nextval('"prefixes_id_seq"'::text)
Unique keys: prefixes_id_key

niara=# insert into prefixes values ('129.10.0.0', '10913 1239 1 i', '1');
INSERT 415033 1
niara=# select prefix from prefixes where prefix = '129.10.0.0';
    prefix
---------------
 129.10.0.0/32
(1 row)



Thanks,

Paul Schultz


Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-06-17 03:27:39
Subject: Re: classful cidr insertion bug?
Previous:From: Tomoyuki NiijimaDate: 2002-06-16 12:14:14
Subject: Apache 1.3.19 could not load libpq.so of PostgreSQL 7.2.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group