Skip to content

Commit

Permalink
mup: update __str__ fmt struct
Browse files Browse the repository at this point in the history
  • Loading branch information
takehaya committed Dec 20, 2023
1 parent de4d280 commit 14dd27a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/exabgp/bgp/message/update/nlri/mup/t1st.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __ne__(self, other):
return not self.__eq__(other)

def __str__(self):
s = "%s:%s:%s%s:%s:%s:%s%s" % (
return"%s:%s:%s%s:%s:%s:%s%s:%s%s" % (
self._prefix(),
self.rd._str(),
self.ipprefix,
Expand All @@ -102,13 +102,10 @@ def __str__(self):
self.qfi,
self.endpoint_ip,
"/%d" % self.ipprefix_len,
self.source_ip if self.source_ip != b"" else "",
"/%d" % (self.source_ip_len if self.source_ip_len != 0 else 0),
)

if self.source_ip_len != 0 and self.source_ip != b'':
s += "%s%s" % (self.source_ip, "/%d" % self.source_ip_len)

return s

def pack_index(self):
# removed teid, qfi, endpointip
packed = self.rd.pack() + pack('!B', self.ipprefix_len) + self.ipprefix.pack()
Expand Down

0 comments on commit 14dd27a

Please sign in to comment.