Skip to content

Commit

Permalink
Update - resolved a value of BGP path attribute "ORIGIN"
Browse files Browse the repository at this point in the history
  • Loading branch information
t2mune committed Jan 8, 2022
1 parent a818ba1 commit 715ebf1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2022-01-08 Tetsumune KISO <[email protected]>
* Update - resolved a value of BGP path attribute "ORIGIN".
* Update - copyright notices.

2020-12-30 Tetsumune KISO <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion examples/mrt2bgpdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def bgp4mp(self, m, count):

def bgp_attr(self, attr):
if attr['type'][0] == BGP_ATTR_T['ORIGIN']:
self.origin = ORIGIN_T[attr['value']]
self.origin = ORIGIN_T[attr['value'][0]]
elif attr['type'][0] == BGP_ATTR_T['NEXT_HOP']:
self.next_hop.append(attr['value'])
elif attr['type'][0] == BGP_ATTR_T['AS_PATH']:
Expand Down
4 changes: 2 additions & 2 deletions examples/mrt2exabgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def print_route_bgp4mp(args, params, m):
if params['next_hop']:
nh_line = ' next-hop %s' % params['next_hop']
sys.stdout.write(
'%swithdraw %s%s%s nlri%s%s\n' % (
'%swithdrawn %s%s%s nlri%s%s\n' % (
params['pre_line'], params['api_grp_syntax'], attr_line,
nh_line, wd_line, params['post_line']
)
Expand Down Expand Up @@ -387,7 +387,7 @@ def get_bgp_attr(args, params, m, attr):
line += ' atomic-aggregate'

if attr['type'][0] == BGP_ATTR_T['ORIGIN']:
line += ' origin %s' % ORIGIN_T[attr['value']]
line += ' origin %s' % ORIGIN_T[attr['value'][0]]

elif attr['type'][0] == BGP_ATTR_T['AS_PATH']:
if flags & FLAG_T['SINGLE']:
Expand Down
3 changes: 2 additions & 1 deletion mrtparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,8 @@ def unpack_origin(self):
'''
Decoder for ORIGIN attribute
'''
self.data['value'] = self.val_num(1)
self.data['value'] = [self.val_num(1)]
self.data['value'].append(ORIGIN_T[self.data['value'][0]])

def unpack_as_path(self):
'''
Expand Down

0 comments on commit 715ebf1

Please sign in to comment.