bgp/bmp: bug fix. remove redundant construction of path attributes

BGPPathAttributeNextHop and BGPPathAttributeMpReachNLRI is already in
new_pathattr. so stop construct and append it to new_pathattr list.

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 2015-02-13 05:58:37 +09:00 committed by FUJITA Tomonori
parent b04e98faa7
commit 83c5c15cd3

View File

@ -173,18 +173,8 @@ class BMPClient(Activity):
new_pathattr.append(mpunreach_attr)
else:
if isinstance(path, Ipv4Path):
nexthop_attr = BGPPathAttributeNextHop(path.nexthop)
new_pathattr.append(nexthop_attr)
return BGPUpdate(nlri=[path.nlri],
path_attributes=new_pathattr)
else:
mpnlri_attr = BGPPathAttributeMpReachNLRI(
path.route_family.afi,
path.route_family.safi,
path.nexthop,
[path.nlri]
)
new_pathattr.append(mpnlri_attr)
return BGPUpdate(path_attributes=new_pathattr)