Skip to content

Commit 6b9d9b1

Browse files
committed
cmd: remove "global" magic keyword
It's not a good idea to use the magic keyword, "global". The API handle an empty table name as the global rib. So no need to use "global". Signed-off-by: FUJITA Tomonori <[email protected]>
1 parent 8d03fe5 commit 6b9d9b1

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

cmd/gobgp/common.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ import (
4040
"github.com/osrg/gobgp/v4/pkg/packet/bgp"
4141
)
4242

43-
const globalRIBName = "global"
44-
4543
const (
4644
cmdGlobal = "global"
4745
cmdNeighbor = "neighbor"

cmd/gobgp/neighbor.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,6 @@ func showNeighborPolicy(remoteIP, policyType string, indent int) error {
11621162
default:
11631163
return fmt.Errorf("invalid policy type: choose from (import|export)")
11641164
}
1165-
if remoteIP == "" {
1166-
remoteIP = globalRIBName
1167-
}
11681165
stream, err := client.ListPolicyAssignment(ctx, &api.ListPolicyAssignmentRequest{
11691166
Name: remoteIP,
11701167
Direction: dir,
@@ -1216,10 +1213,6 @@ func extractDefaultAction(args []string) ([]string, api.RouteAction, error) {
12161213
}
12171214

12181215
func modNeighborPolicy(remoteIP, policyType, cmdType string, args []string) error {
1219-
if remoteIP == "" {
1220-
remoteIP = globalRIBName
1221-
}
1222-
12231216
assign := &api.PolicyAssignment{
12241217
Name: remoteIP,
12251218
}

0 commit comments

Comments
 (0)