summaryrefslogtreecommitdiffhomepage
path: root/server/fsm.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-02-27 09:49:35 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2018-04-03 09:16:41 +0900
commit264bd0ca126bf721687764332a01315d56e5b671 (patch)
tree05a0eb911e99fcba2a621fde34f6fc749f130d1d /server/fsm.go
parenta25522edddf05653bef26c5ff220f34f7354791f (diff)
packet/bgp: Getter functions for AS segment
This patch adds getter functions for the segment type and AS list of each segment without using type assertion. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'server/fsm.go')
-rw-r--r--server/fsm.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/fsm.go b/server/fsm.go
index 2c2128cb..c121c85f 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -677,10 +677,10 @@ func getPathAttrFromBGPUpdate(m *bgp.BGPUpdate, typ bgp.BGPAttrType) bgp.PathAtt
return nil
}
-func hasOwnASLoop(ownAS uint32, limit int, aspath *bgp.PathAttributeAsPath) bool {
+func hasOwnASLoop(ownAS uint32, limit int, asPath *bgp.PathAttributeAsPath) bool {
cnt := 0
- for _, i := range aspath.Value {
- for _, as := range i.(*bgp.As4PathParam).AS {
+ for _, param := range asPath.Value {
+ for _, as := range param.GetAS() {
if as == ownAS {
cnt++
if cnt > limit {