bgp: keep and use nexthop value as a string internally

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

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
ISHIDA Wataru 2014-05-30 11:09:29 +09:00 committed by FUJITA Tomonori
parent 24cc165d87
commit 44725bce37
3 changed files with 3 additions and 4 deletions

View File

@ -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([[]])

View File

@ -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 ''

View File

@ -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: