Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NA" BGP Prefix causes error #13

Closed
dacamp opened this issue Oct 8, 2018 · 7 comments
Closed

"NA" BGP Prefix causes error #13

dacamp opened this issue Oct 8, 2018 · 7 comments

Comments

@dacamp
Copy link
Contributor

dacamp commented Oct 8, 2018

Sorry I didn't catch this in issue #10, but the BGP Prefix can also be "NA", which causes an error on the client side.

The "AS Name" field is also NA, so that may cause an issue too.

Raw Value: NA      | 193.32.71.189    | NA                  | UA | ripencc  | 2018-04-26 | NA
2018/10/08 14:17:41 There was an error: invalid CIDR address: NA
@dacamp
Copy link
Contributor Author

dacamp commented Oct 8, 2018

This was the fix I have in place, but that will set Response.Range to nil, which may possibly break client code.

// Read range
if string(tokens[2]) != "NA" {
        if _, re.Range, err = net.ParseCIDR(string(tokens[2])); err != nil {
        return
        }
}

@ammario
Copy link
Owner

ammario commented Oct 8, 2018

Hmm.. How about setting it to 0.0.0.0/32?

@dacamp
Copy link
Contributor Author

dacamp commented Oct 8, 2018

Since it's unknown I think 0.0.0.0/0 makes more sense

@ammario
Copy link
Owner

ammario commented Oct 8, 2018

I think it would be safer for a consumer to assume that the ISP contains no IP ranges than every IP.

@dacamp
Copy link
Contributor Author

dacamp commented Oct 8, 2018

0.0.0.0/0 is known as the default route, but I can see where you're coming from.

How about something like using the IP address as a /32? For the above example 193.32.71.189/32?

All of the solutions feel hokey, so I don't have a good answer.

@ammario
Copy link
Owner

ammario commented Oct 8, 2018 via email

@ammario
Copy link
Owner

ammario commented Oct 9, 2018

Fixed in #15

@ammario ammario closed this as completed Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants