This was intro'd in 6e4c533e8a08fab823a30d236dee661a447c9952
Since I did not expect the sending PDU channel to be _slightly_
slower than just yeeting the socket closed instantly.
Regardless, TCP disconnection now happens when the sendloop is dead,
that should allow for Error PDUs etc to be sent out before
Tag: https://github.com/bgp/stayrtr/issues/90
This fixes https://github.com/bgp/stayrtr/issues/44, otherwise
default settings means that OctoRPKI does not load correctly with
StayRTR.
Me and Job figure that its not worth supporting FORT files since
they have their own RTR-er.
It is not pretty, I didnt really want to overhaul the whole tool
since I also use this tool to test my own releases of stayrtr.
So instead bgpsec router keys are injected as "special" VRPs.
Since RTRMon is not complying to a standard, I feel we can be more
flexible here.
Tag: https://github.com/bgp/stayrtr/issues/57
This imports and exports BGPsec router key data, and exports router
key data out over RTR to supporting clients (any version higher than 1)
Since it's obvious that at some point there will be clients that will
have issues seeing a RouterKey PDU for the first time ever, I've
included a -disable.bgpsec flag to prevent them from being sent.
That way if someone is caught off guard during an upgrade, they can
disable it and keep upgrading.
Tag: https://github.com/bgp/stayrtr/issues/57
This allows the previous commit to be fully effecitve.
Since some tests showed potential for a nasty set of pointer
edge cases to appear, I will be running rtrmon between this and
a known "okay" version for a few hours to confirm I have not broken
anything.
This does a bunch of work (and it's not fully done, since VRP needs
to be converted into *VRP across the codebase to ensure that SetFlag()
works) to let what was the VRPManager diffing/dispatch system support
things that are not VRPs. We need to do this since we are looking
to support BGPsec Router Keys and ASPA objects soon. And a previous
attempt to write such support resulted in a unaccptable amount of
duplicate code.
Doing it this way will also make it a lot easier to extend StayRTR
to support whatever is after ASPA.
Previously StayRTR would copy the client's Session ID back into the Cache
Response send to the router, even though the cache's internal Session ID
was something different.
The purpose of the Session ID is to help both router and cache understand
whether they are synchronized or not. There are two opportunities to fix
desyncs: if the cache recognises the router is desynced, the cache informs
the router (through an Error Report) to reconnect and send a Reset Query.
If the router recognises it is out of sync with the cache, the router can
send a Reset Query.
According to RFC 8210 section 5.1 the cache should send "Corrupt Data" when
a router sends a Serial Query with an unknown Session ID:
```
Session ID: A 16-bit unsigned integer. When a cache server is
started, it generates a Session ID to identify the instance of the
cache and to bind it to the sequence of Serial Numbers that cache
instance will generate. This allows the router to restart a
failed session knowing that the Serial Number it is using is
commensurate with that of the cache. If, at any time after the
protocol version has been negotiated (Section 7), either the
router or the cache finds that the value of the Session ID is not
the same as the other's, the party which detects the mismatch MUST
immediately terminate the session with an Error Report PDU with
code 0 ("Corrupt Data"), and the router MUST flush all data
learned from that cache.
```
Reformat with gofmt from Ties