Skip to content

Commit

Permalink
fixing bad mup t1st generation
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Jun 9, 2024
1 parent 08a28b1 commit 9eccd33
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/exabgp/bgp/message/update/nlri/mup/t1st.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ def unpack(cls, data, afi):
size += 1

if endpoint_ip_len in [32, 128]:
endpoint_ip = IP.unpack(data[size : size + endpoint_ip_len])
size += endpoint_ip_len
ep_len = endpoint_ip_len // 8
endpoint_ip = IP.unpack(data[size : size + ep_len])
size += ep_len
else:
raise RuntimeError('mup t1st endpoint ip length is not 32bit or 128bit, unexpect len: %d' % endpoint_ip_len)

Expand All @@ -200,12 +201,13 @@ def unpack(cls, data, afi):
source_ip_len = data[size]
size += 1
if source_ip_len in [32, 128]:
source_ip = IP.unpack(data[size : size + source_ip_len])
size += source_ip_len
sip_len = source_ip_len // 8
source_ip = IP.unpack(data[size : size + sip_len])
size += sip_len
else:
raise RuntimeError('mup t1st source ip length is not 32bit or 128bit, unexpect len: %d' % source_ip_len)

return cls(rd, ipprefix_len, ipprefix, teid, qfi, endpoint_ip_len, endpoint_ip, source_ip_len, source_ip, afi)
return cls(rd, ipprefix_len, ipprefix, teid, qfi, endpoint_ip_len, endpoint_ip, afi, source_ip_len, source_ip)

def json(self, compact=None):
content = '"arch": %d, ' % self.ARCHTYPE
Expand Down

0 comments on commit 9eccd33

Please sign in to comment.