From 7fbfc04597730fceecb96de24377bb1665a958d4 Mon Sep 17 00:00:00 2001 From: Job Snijders Date: Wed, 11 Sep 2024 15:12:24 +0000 Subject: [PATCH] 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