Skip to content

Commit

Permalink
Fix show results of LsAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
watal committed Jan 10, 2023
1 parent 7651e60 commit a555074
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/packet/bgp/bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9299,8 +9299,10 @@ func (p *PathAttributeLs) String() string {
for _, tlv := range p.TLVs {
buf.WriteString(fmt.Sprintf("%s ", tlv.String()))
}

return fmt.Sprintf("{LsAttributes: %s}", buf.String())
if buf.String() != "" {
return fmt.Sprintf("{LsAttributes: %s}", buf.String())
}
return ""
}

func (p *PathAttributeLs) MarshalJSON() ([]byte, error) {
Expand Down

0 comments on commit a555074

Please sign in to comment.