Skip to content

Imported LIR entries have overlapping ranges #52

@kloesing

Description

@kloesing

Some LIR assignment ranges have overlapping ranges, but the lookup code assumes that is not the case. For example:

sqlite> SELECT * FROM assignments WHERE start_hex >= '080000000' ORDER BY start_hex LIMIT 10;
080000000|081000000|ipv4|EU # Country is really world wide|lir|ripencc
080000000|080000800|ipv4|RO|lir|ripencc
080000000|080000100|ipv4|ro|lir|ripencc
080000000|080000800|ipv4|RO|rir|ripencc
[...]

Now, if we look up IPv4 address 128.0.0.0 (note that hex 080000000 is 9 chars long, so this is hex 0 80 00 00 00), we get:

~/src/blockfinder$ ./blockfinder -4 128.0.0.0
Your cached RIR files are older than 24 hours; you probably want to update them.
Reverse lookup for: 128.0.0.0
RIR country code: RO
LIR country code: EU # Country field is actually all countries in the world and not just EU countries

I think we have 2 options here. Either we clean up the input data somehow, so that there are no overlapping assignment ranges, or we output all matching assignment ranges and the user figures out herself what that means. I slightly lean towards the second option, but mostly because I have no idea how to clean up the input data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions