bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
91 stars 13 forks source link

return if no vrps are loaded #68

Closed job closed 2 years ago

job commented 2 years ago

If the VRP set can't be retrieved, an error pops up:

feather$ ./stayrtr -cache http://localhost/
ERRO[0000] Error updating: Get "http://localhost/": dial tcp [::1]:80: connect: connection refused
WARN[0000] Error setting up intial state: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006"
WARN[0000] Initial sync not complete. Refreshing every 30 seconds
INFO[0000] StayRTR Server started (sessionID:44976, refresh:3600, retry:600, expire:7200)

This PR silences the error by returning before the checkTime/buildtime dance - but I'm not sure if that's the best path forward.

ties commented 2 years ago

Do you think https://datatracker.ietf.org/doc/html/rfc6810#section-6.4 is well handled in routers? (And when I'm on a desktop pc I'll check if we return that PDU)

I will look at this PR better later. No vpr attribute in the json (not even an empty list) feels like an error state, maybe we should return an error about unexpected data?

ties commented 2 years ago

Definitely a local improvement 👍