Instead of BGPPathAttributeNextHop, keep nexthop value as a string.
Convert it to string as we get Update msg.

Signed-off-by: ISHIDA Wataru <[email protected]>
---
 ryu/services/protocols/bgp/core_managers/table_manager.py |    3 +--
 ryu/services/protocols/bgp/operator/internal_api.py       |    2 +-
 ryu/services/protocols/bgp/peer.py                        |    2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/ryu/services/protocols/bgp/core_managers/table_manager.py
b/ryu/services/protocols/bgp/core_managers/table_manager.py
index a701644..2ec0d80 100644
--- a/ryu/services/protocols/bgp/core_managers/table_manager.py
+++ b/ryu/services/protocols/bgp/core_managers/table_manager.py
@@ -20,7 +20,6 @@ from ryu.lib.packet.bgp import RF_IPv6_UC
 from ryu.lib.packet.bgp import RF_IPv4_VPN
 from ryu.lib.packet.bgp import RF_IPv6_VPN
 from ryu.lib.packet.bgp import RF_RTC_UC
-from ryu.lib.packet.bgp import BGPPathAttributeNextHop
 from ryu.lib.packet.bgp import BGPPathAttributeOrigin
 from ryu.lib.packet.bgp import BGPPathAttributeAsPath
 from ryu.lib.packet.bgp import BGP_ATTR_TYPE_ORIGIN
@@ -489,7 +488,7 @@ class TableCoreManager(object):
         src_ver_num = 1
         peer = None
         # set mandatory path attributes
-        nexthop = BGPPathAttributeNextHop("0.0.0.0")
+        nexthop = '0.0.0.0'
         origin = BGPPathAttributeOrigin(BGP_ATTR_ORIGIN_IGP)
         aspath = BGPPathAttributeAsPath([[]])

diff --git a/ryu/services/protocols/bgp/operator/internal_api.py
b/ryu/services/protocols/bgp/operator/internal_api.py
index c3a420e..d23bdea 100644
--- a/ryu/services/protocols/bgp/operator/internal_api.py
+++ b/ryu/services/protocols/bgp/operator/internal_api.py
@@ -119,7 +119,7 @@ class InternalApi(object):
             elif origin == BGP_ATTR_ORIGIN_EGP:
                 origin = 'e'

-            nexthop = path.nexthop.value
+            nexthop = path.nexthop
             # Get the MED path attribute
             med = path.get_pattr(BGP_ATTR_TYPE_MULTI_EXIT_DISC)
             med = med.value if med else ''
diff --git a/ryu/services/protocols/bgp/peer.py
b/ryu/services/protocols/bgp/peer.py
index 0779206..ab14e5a 100644
--- a/ryu/services/protocols/bgp/peer.py
+++ b/ryu/services/protocols/bgp/peer.py
@@ -1128,7 +1128,7 @@ class Peer(Source, Sink, NeighborConfListener,
Activity):
                       ' UPDATE. %s' % update_msg)
             return

-        next_hop = update_msg.get_path_attr(BGP_ATTR_TYPE_NEXT_HOP)
+        next_hop = update_msg.get_path_attr(BGP_ATTR_TYPE_NEXT_HOP).value
         # Nothing to do if we do not have any new NLRIs in this message.
         msg_nlri_list = update_msg.nlri
         if not msg_nlri_list:
-- 
1.7.10.4




------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to