From 715deaebb8c555ca5245da738fc16a6d3ad382f5 Mon Sep 17 00:00:00 2001 From: Benedikt Rudolph Date: Mon, 2 Jul 2018 15:02:05 +0200 Subject: [PATCH] Fix quotation error Routes{Table,Lookup}* method The commands submitted to birdc contain "'" characters placed before and after ip-address/prefix and table name. In normal operation of birdc they are eliminated by the shell. However when given as arguments to birdc directly they cause "IP address expected" error in Bird. Credits: Felix Singer for finding and submitting this bug. --- bird/bird.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bird/bird.go b/bird/bird.go index a552888..ebf1191 100644 --- a/bird/bird.go +++ b/bird/bird.go @@ -235,19 +235,19 @@ func RoutesExportCount(protocol string) (Parsed, bool) { } func RoutesTable(table string) (Parsed, bool) { - return RunAndParse("route table '"+table+"' all", parseRoutes) + return RunAndParse("route table "+table+" all", parseRoutes) } func RoutesTableCount(table string) (Parsed, bool) { - return RunAndParse("route table '"+table+"' count", parseRoutesCount) + return RunAndParse("route table "+table+" count", parseRoutesCount) } func RoutesLookupTable(net string, table string) (Parsed, bool) { - return RunAndParse("route for '"+net+"' table '"+table+"' all", parseRoutes) + return RunAndParse("route for "+net+" table "+table+" all", parseRoutes) } func RoutesLookupProtocol(net string, protocol string) (Parsed, bool) { - return RunAndParse("route for '"+net+"' protocol '"+protocol+"' all", parseRoutes) + return RunAndParse("route for "+net+" protocol "+protocol+" all", parseRoutes) } func RoutesPeer(peer string) (Parsed, bool) {