summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/cmd/common.go2
-rw-r--r--cmd/gobgp/cmd/neighbor.go2
-rw-r--r--cmd/gobgpd/main.go4
3 files changed, 6 insertions, 2 deletions
diff --git a/cmd/gobgp/cmd/common.go b/cmd/gobgp/cmd/common.go
index a1104836..f4a72b1e 100644
--- a/cmd/gobgp/cmd/common.go
+++ b/cmd/gobgp/cmd/common.go
@@ -32,6 +32,8 @@ import (
"github.com/osrg/gobgp/pkg/packet/bgp"
)
+const GLOBAL_RIB_NAME = "global"
+
const (
CMD_GLOBAL = "global"
CMD_NEIGHBOR = "neighbor"
diff --git a/cmd/gobgp/cmd/neighbor.go b/cmd/gobgp/cmd/neighbor.go
index 6bd531a6..e863003a 100644
--- a/cmd/gobgp/cmd/neighbor.go
+++ b/cmd/gobgp/cmd/neighbor.go
@@ -1072,6 +1072,8 @@ func modNeighborPolicy(remoteIP, policyType, cmdType string, args []string) erro
resource := api.Resource_GLOBAL
if remoteIP != "" {
resource = api.Resource_LOCAL
+ } else {
+ remoteIP = GLOBAL_RIB_NAME
}
assign := &api.PolicyAssignment{
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go
index 146facad..463387b9 100644
--- a/cmd/gobgpd/main.go
+++ b/cmd/gobgpd/main.go
@@ -334,7 +334,7 @@ func main() {
ps := toPolicies(a.ImportPolicyList)
apiServer.ReplacePolicyAssignment(context.Background(), &api.ReplacePolicyAssignmentRequest{
Assignment: server.NewAPIPolicyAssignmentFromTableStruct(&table.PolicyAssignment{
- Name: "",
+ Name: table.GLOBAL_RIB_NAME,
Type: table.POLICY_DIRECTION_IMPORT,
Policies: ps,
Default: def,
@@ -345,7 +345,7 @@ func main() {
ps = toPolicies(a.ExportPolicyList)
apiServer.ReplacePolicyAssignment(context.Background(), &api.ReplacePolicyAssignmentRequest{
Assignment: server.NewAPIPolicyAssignmentFromTableStruct(&table.PolicyAssignment{
- Name: "",
+ Name: table.GLOBAL_RIB_NAME,
Type: table.POLICY_DIRECTION_EXPORT,
Policies: ps,
Default: def,