1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00

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.
This commit is contained in:
Benedikt Rudolph 2018-07-02 15:02:05 +02:00
parent fdfa4cbc32
commit 715deaebb8

View file

@ -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) {