Open agallo opened 4 years ago
Will fix. Thank you for reporting
I prepared a PR, let me know if you are able to test it. It should silently discard invalid prefixes. Adding logging would be doable in the future. I prefer this instead of dropping the whole SLURM (I may be wrong). The first error is due to JSON decoding so it just does not accept the file.
I'd be happy to test. Just let me know
I merged the change on master: could you git pull
and go build
inside cmd/gortr
?
I don't see any more panics. Thanks for the quick fix!
I did some testing and found that goRTR either panics or has undesirable behavior if invalid data is provided. Maybe do some sanity checking before accepting data?
When an invalid prefix (v4 or v6, either the address portion or mask portion) is provided in the prefix assertion section, goRTR panics with:
example entry used to cause this:
If an invalid ASN is provided, there is no panic, this message is logged:
And goRTR ignores all entries in the Prefix Assertion section
code used to generate this:
For the local assertions, things got a bit worse- An invalid address specification, such as
results in goRTR filtering everything:
All entries from the upstream validator (I'm using octoRPKI in this test) are filtered. I confirmed that only 2 prefixes made it to the router I was testing with.
Maybe provide some sanity checking for the input via SLURM?
Thank you.