1
0
mirror of https://github.com/bgp/stayrtr.git synced 2024-05-06 15:54:54 +00:00

355 Commits

Author SHA1 Message Date
c112384f21 Tag v0.5.1 v0.5.1 2023-03-01 14:36:19 +00:00
5a3782245c Fix (false positive) test failure caused by the prev commit 2023-03-01 14:20:53 +00:00
62f5952776 Fix lock/slow sending due to a lock "moshpit"
Instead we now sort while processing, a much much safer place to
do it!
2023-03-01 14:15:18 +00:00
28752753e0 Harden ^b2a79528c5d221f46bdd766ce9c448714f3b62d5
It appears that the sorting function can be prone to data races.
This commit puts a lock on that.

Tag: https://github.com/bgp/stayrtr/issues/92
2023-02-27 16:03:03 +00:00
b2a79528c5 Fix possible crash from ROA PDU Race Minimization logic
Should fix the issue at the bottom

Tag https://github.com/bgp/stayrtr/issues/92
2023-02-27 15:17:53 +00:00
cc9cdbf5af Merge pull request #91 from cjeker/update_go_mod
Update following go modules to their newest proper version
2023-02-27 14:24:45 +00:00
eb8d6dc594 Update following go modules to:
golang.org/x/crypto v0.6.0
    golang.org/x/sys v0.5.0
2023-02-24 17:24:58 +01:00
8a3a71e045 Ensure error PDUs are sent before the TCP socket closes
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
2023-02-24 14:13:45 +00:00
df1dbde933 Fix auto docker release tag push v0.5.0 2023-02-23 21:35:40 +00:00
a2c661f286 Release v0.5.0 2023-02-23 21:32:19 +00:00
016596c773 Correct the README on where to find the pre-built docker 2023-02-23 21:31:09 +00:00
94ab410dfe Add E2E testing for Slurm parsing for ASPA and BGPsec 2023-02-23 21:14:56 +00:00
1e32148e7b Implement draft-spaghetti-sidrops-aspa-slurm-0 2023-02-23 20:40:20 +00:00
643bccfd07 Add parsing support for ASPA/BGPSEC in SLURM files
Using draft-spaghetti-sidrops-aspa-slurm as a base to work off

No filtering/asserts are done yet, that comes shortly
2023-02-23 17:41:32 +00:00
fa548afcaf Rename BSK(s) (BGPsecKey) to BRK's to algin with rpki-client
And rename ASPA stuff to VAPs
2023-02-23 17:01:12 +00:00
547eea1d54 Build a docker hub release for tag names too
Closes: https://github.com/bgp/stayrtr/issues/80
Closes: https://github.com/bgp/stayrtr/issues/19
2023-02-23 16:48:04 +00:00
4a8bf3e86c Add v2 support to README 2023-02-23 16:47:53 +00:00
c6ffc72060 Undo default cache endpoint change to Cloudflare
Was a mistake while testing. Since changing the defaults makes it
a lot easier to play with the debugger
2023-02-23 16:24:27 +00:00
38feb049b4 Handle OctoRPKI's alternate build time metadata.
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.
2023-02-23 16:20:43 +00:00
d5dc99a4d0 Merge pull request #88 from bgp/draft-ietf-sidrops-8210bis-10
Implement draft-ietf-sidrops-8210bis-10
2023-02-23 16:13:44 +00:00
c007dea967 Handle RTR version 2 hangups by suggesting the user manually downgrade
This currently happens with rtr.rpki.cloudflare.com:8282
2023-02-23 16:05:11 +00:00
b09f0e27f0 Set default StayRTR version to v2 (With ASPA support) 2023-02-23 15:56:30 +00:00
3555d81035 Add -disable.aspa flag
Just in case!
2023-02-23 12:21:27 +00:00
0753777f1f Revert "Set default StayRTR version to 2"
This reverts commit f40e9ccf4e30e968ad6b076b4bee438d566552fa.

Cannot do this, Cloudflare's RTR server cannot deal with this
2023-02-23 12:21:03 +00:00
f40e9ccf4e Set default StayRTR version to 2
Addresses: https://github.com/bgp/stayrtr/pull/88#issuecomment-1440565663
2023-02-23 12:16:26 +00:00
e98648f8b2 Implement draft-ietf-sidrops-8210bis-10 ROA PDU Race Minimization
It will now sort entries before they go out, Sorted by:

Largest CIDR > Largest Max Length > IP address
2023-02-22 17:36:06 +00:00
187410d9b6 Implment ASPA as defined in draft-ietf-sidrops-8210bis-10
Tag: https://github.com/bgp/stayrtr/issues/79
2023-02-22 17:18:46 +00:00
3b73956a9c Add PDU encode/decode support for ASPA 2023-02-22 15:17:26 +00:00
48e29bb427 Update license file 2023-02-22 12:31:48 +00:00
26be18ae2e Merge branch 'master' of github.com:bgp/stayrtr 2023-02-22 11:42:05 +00:00
9edbfb3ba1 Add basic BGPsec support to RTRMon
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
2023-02-22 11:40:15 +00:00
849f29eb03 mention PCCW 2023-02-22 11:02:15 +00:00
539a99d76c More cleanup of unused functions and/or struct contents 2023-02-21 22:16:26 +00:00
caad9d419f Cleanup unused struct fields 2023-02-21 22:14:20 +00:00
6e4c533e8a Fix client.sendLoop possibly leaking/CPU burning
Basically, until now it was not possible for it to actually
exit since the break only breaks the for loop it's connected in
2023-02-21 22:11:43 +00:00
19ca7b27e9 Add BGPsec Router Key support to rtrdump
Tag: https://github.com/bgp/stayrtr/issues/57
2023-02-21 22:05:50 +00:00
513bda0e5f Implement BGPsec support
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
2023-02-21 21:55:50 +00:00
b08f5383ac Convert lib.VRP to *lib.VRP
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.
2023-02-21 21:15:13 +00:00
925ac75c42 Move all []VRP's to []SendableData in prep to support non VRP things
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.
2023-02-21 20:40:00 +00:00
a9d36b4707 Fix BGPsec ROUTER_KEY encoding/decoding
Also add a test to ensure it keeps decoding correctly
2023-02-21 19:52:36 +00:00
f8b0c87ec8 Merge pull request #83 from bgp/pledge
On OpenBSD restrict access to system calls with pledge()
2023-02-06 11:15:30 +00:00
535becd0c3 Merge pull request #87 from bgp/remove_sessionid_modifier
Always automatically generate a RTR Session ID
2023-02-06 11:14:10 +00:00
bd5a54d54d Always automatically generate a RTR Session ID 2023-02-06 11:10:07 +00:00
1319beff75 Merge pull request #84 from bgp/send_error_to_desync_clients
Bugfix: don't echo the router's session_id back to the router, instead report an error
2023-02-03 21:44:50 +00:00
d5be6983b5 Bugfix: don't echo the router's session_id back to the router, instead report an error
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
2023-02-03 21:37:30 +00:00
d9b3679d0a On OpenBSD restrict access to system calls with pledge() 2023-01-30 21:25:21 +00:00
3bc6c95061 Upgrade CodeQL to v2 2023-01-30 21:24:39 +00:00
f257f675ec Upgrade CodeQL to v2 2023-01-30 21:18:53 +00:00
949f7c457c Merge pull request #81 from hellt/nokia-examples
Added Nokia SR OS example configuration
2023-01-26 17:59:21 +01:00
cbf19feca3 added nokia sros examples 2023-01-26 17:45:42 +01:00