From 7fbfc04597730fceecb96de24377bb1665a958d4 Mon Sep 17 00:00:00 2001 From: Job Snijders Date: Wed, 11 Sep 2024 15:12:24 +0000 Subject: [PATCH 1/3] Clean up more RTR v2 remnants --- cmd/rtrdump/rtrdump.go | 9 ++------- cmd/stayrtr/stayrtr.go | 1 - lib/client.go | 14 -------------- lib/structs.go | 1 - 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/cmd/rtrdump/rtrdump.go b/cmd/rtrdump/rtrdump.go index 69ead19..d79e487 100644 --- a/cmd/rtrdump/rtrdump.go +++ b/cmd/rtrdump/rtrdump.go @@ -147,13 +147,11 @@ func main() { } targetVersion := rtr.PROTOCOL_VERSION_0 - if *FlagVersion > 2 { - log.Fatalf("Invalid RTR Version provided, the highest version this release supports is 2") + if *FlagVersion > 1 { + log.Fatalf("Invalid RTR Version provided, the highest version this release supports is 1") } if *FlagVersion == 1 { targetVersion = rtr.PROTOCOL_VERSION_1 - } else if *FlagVersion == 2 { - targetVersion = rtr.PROTOCOL_VERSION_2 } lvl, _ := log.ParseLevel(*LogLevel) @@ -225,9 +223,6 @@ func main() { log.Infof("Connecting with %v to %v", *ConnType, *Connect) err := clientSession.Start(*Connect, typeToId[*ConnType], configTLS, configSSH) if err != nil { - if err == io.EOF && targetVersion == rtr.PROTOCOL_VERSION_2 { - log.Warnf("EOF From remote side, This might be due to version 2 being requested, try using -rtr.version 1") - } log.Fatal(err) } diff --git a/cmd/stayrtr/stayrtr.go b/cmd/stayrtr/stayrtr.go index 7534e34..1291b8d 100644 --- a/cmd/stayrtr/stayrtr.go +++ b/cmd/stayrtr/stayrtr.go @@ -155,7 +155,6 @@ var ( protoverToLib = map[int]uint8{ 0: rtr.PROTOCOL_VERSION_0, 1: rtr.PROTOCOL_VERSION_1, - 2: rtr.PROTOCOL_VERSION_2, } ) diff --git a/lib/client.go b/lib/client.go index 8d0d30c..bffa9de 100644 --- a/lib/client.go +++ b/lib/client.go @@ -122,20 +122,6 @@ func (c *ClientSession) StartRW(rd io.Reader, wr io.Writer) error { } c.version = PROTOCOL_VERSION_0 } - if c.version == PROTOCOL_VERSION_2 { - downgraded := false - switch dec.GetVersion() { - case PROTOCOL_VERSION_0: - c.version = PROTOCOL_VERSION_0 - downgraded = true - case PROTOCOL_VERSION_1: - c.version = PROTOCOL_VERSION_1 - downgraded = true - } - if c.log != nil && downgraded { - c.log.Infof("Downgrading to version %d", c.version) - } - } if c.handler != nil { c.handler.HandlePDU(c, dec) diff --git a/lib/structs.go b/lib/structs.go index 78ad6f8..d7603e3 100644 --- a/lib/structs.go +++ b/lib/structs.go @@ -30,7 +30,6 @@ const ( PROTOCOL_VERSION_0 = 0 PROTOCOL_VERSION_1 = 1 - PROTOCOL_VERSION_2 = 2 PDU_ID_SERIAL_NOTIFY = 0 PDU_ID_SERIAL_QUERY = 1 From 93db6e98595dcf71a4e035faa8767c0afa7f833d Mon Sep 17 00:00:00 2001 From: Job Snijders Date: Wed, 11 Sep 2024 15:13:34 +0000 Subject: [PATCH 2/3] More v2 cleanup --- lib/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server.go b/lib/server.go index 62ec600..0b695be 100644 --- a/lib/server.go +++ b/lib/server.go @@ -717,7 +717,7 @@ func (c *Client) SetDisableVersionCheck(disableCheck bool) { } func (c *Client) checkVersion(newversion uint8) { - if (!c.versionset || newversion == c.version) && (newversion == PROTOCOL_VERSION_2 || newversion == PROTOCOL_VERSION_1 || newversion == PROTOCOL_VERSION_0) { + if (!c.versionset || newversion == c.version) && (newversion == PROTOCOL_VERSION_1 || newversion == PROTOCOL_VERSION_0) { c.SetVersion(newversion) } else { if c.log != nil { From fba3f3313f9782b4361b515148d0234bdf6d286b Mon Sep 17 00:00:00 2001 From: Job Snijders Date: Wed, 11 Sep 2024 15:14:41 +0000 Subject: [PATCH 3/3] more v2 cleanup --- cmd/rtrdump/rtrdump.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rtrdump/rtrdump.go b/cmd/rtrdump/rtrdump.go index d79e487..76c196e 100644 --- a/cmd/rtrdump/rtrdump.go +++ b/cmd/rtrdump/rtrdump.go @@ -36,7 +36,7 @@ var ( Serial = flag.Int("serial.value", 0, "Serial number") Session = flag.Int("session.id", 0, "Session ID") - FlagVersion = flag.Int("rtr.version", 2, "What RTR version you want to use, Version 2 is draft-ietf-sidrops-8210bis-10") + FlagVersion = flag.Int("rtr.version", 1, "What RTR version you want to use, Version 1 is RFC8210") ConnType = flag.String("type", "plain", "Type of connection: plain, tls or ssh") ValidateCert = flag.Bool("tls.validate", true, "Validate TLS")