diff options
author | Carl Baldwin <carl@ecbaldwin.net> | 2019-10-11 14:25:08 -0600 |
---|---|---|
committer | Carl Baldwin <carl@ecbaldwin.net> | 2019-10-11 17:28:15 -0600 |
commit | ea87564b5b5d332ab48b6619c4a365559111e2c9 (patch) | |
tree | 5244bb4503ee2d299ef4930957472690edbb5c3e /pkg/server | |
parent | 1c8da637d4d730b268becb6b87efadc5c0872f53 (diff) |
Remove policy from FSM
The `policy` member of fsm is apparently never used. Clean it up to
avoid confusion. Policy is still set on the server and peers.
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/fsm.go | 4 | ||||
-rw-r--r-- | pkg/server/fsm_test.go | 3 | ||||
-rw-r--r-- | pkg/server/peer.go | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/pkg/server/fsm.go b/pkg/server/fsm.go index b06ddd5d..39618aa5 100644 --- a/pkg/server/fsm.go +++ b/pkg/server/fsm.go @@ -189,7 +189,6 @@ type fsm struct { capMap map[bgp.BGPCapabilityCode][]bgp.ParameterCapabilityInterface recvOpen *bgp.BGPMessage peerInfo *table.PeerInfo - policy *table.RoutingPolicy gracefulRestartTimer *time.Timer twoByteAsTrans bool marshallingOptions *bgp.MarshallingOption @@ -261,7 +260,7 @@ func (fsm *fsm) bmpStatsUpdate(statType uint16, increment int) { } } -func newFSM(gConf *config.Global, pConf *config.Neighbor, policy *table.RoutingPolicy) *fsm { +func newFSM(gConf *config.Global, pConf *config.Neighbor) *fsm { adminState := adminStateUp if pConf.Config.AdminDown { adminState = adminStateDown @@ -281,7 +280,6 @@ func newFSM(gConf *config.Global, pConf *config.Neighbor, policy *table.RoutingP rfMap: make(map[bgp.RouteFamily]bgp.BGPAddPathMode), capMap: make(map[bgp.BGPCapabilityCode][]bgp.ParameterCapabilityInterface), peerInfo: table.NewPeerInfo(gConf, pConf), - policy: policy, gracefulRestartTimer: time.NewTimer(time.Hour), notification: make(chan *bgp.BGPMessage, 1), } diff --git a/pkg/server/fsm_test.go b/pkg/server/fsm_test.go index ac5ffd7b..9351c71d 100644 --- a/pkg/server/fsm_test.go +++ b/pkg/server/fsm_test.go @@ -26,7 +26,6 @@ import ( "github.com/eapache/channels" "github.com/osrg/gobgp/internal/pkg/config" - "github.com/osrg/gobgp/internal/pkg/table" "github.com/osrg/gobgp/pkg/packet/bgp" log "github.com/sirupsen/logrus" @@ -311,7 +310,7 @@ func TestCheckOwnASLoop(t *testing.T) { func makePeerAndHandler() (*peer, *fsmHandler) { p := &peer{ - fsm: newFSM(&config.Global{}, &config.Neighbor{}, table.NewRoutingPolicy()), + fsm: newFSM(&config.Global{}, &config.Neighbor{}), } h := &fsmHandler{ diff --git a/pkg/server/peer.go b/pkg/server/peer.go index a7843f49..c213a9ea 100644 --- a/pkg/server/peer.go +++ b/pkg/server/peer.go @@ -106,7 +106,7 @@ func newPeer(g *config.Global, conf *config.Neighbor, loc *table.TableManager, p peer := &peer{ localRib: loc, policy: policy, - fsm: newFSM(g, conf, policy), + fsm: newFSM(g, conf), prefixLimitWarned: make(map[bgp.RouteFamily]bool), } if peer.isRouteServerClient() { |