summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorSerguei Bezverkhi <sbezverk@cisco.com>2020-05-07 08:30:22 -0400
committerSerguei Bezverkhi <sbezverk@cisco.com>2020-05-07 08:30:22 -0400
commita8ed57e6612d4d6356adb7fb8bdd1a32ca24c3eb (patch)
tree7062921f30a23e3263fa5129733fd7ca43b37d87 /pkg
parent52fc48e3aba37ec6e4f3dad6815c28e8f7a95882 (diff)
address more static check failures
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/packet/bgp/prefix_sid.go21
1 files changed, 7 insertions, 14 deletions
diff --git a/pkg/packet/bgp/prefix_sid.go b/pkg/packet/bgp/prefix_sid.go
index 6a3f37b9..7dd90082 100644
--- a/pkg/packet/bgp/prefix_sid.go
+++ b/pkg/packet/bgp/prefix_sid.go
@@ -147,10 +147,7 @@ func (p *PathAttributePrefixSID) Extract() *PrefixSIDAttribute {
psid := &PrefixSIDAttribute{
TLVs: make([]PrefixSIDTLVInterface, 0),
}
-
- for _, tlv := range p.TLVs {
- psid.TLVs = append(psid.TLVs, tlv)
- }
+ psid.TLVs = append(psid.TLVs, p.TLVs...)
return psid
}
@@ -241,9 +238,7 @@ func (s *SRv6L3ServiceAttribute) Extract() *SRv6L3Service {
SubTLVs: make([]PrefixSIDTLVInterface, 0),
}
- for _, tlv := range s.SubTLVs {
- l3.SubTLVs = append(l3.SubTLVs, tlv)
- }
+ l3.SubTLVs = append(l3.SubTLVs, s.SubTLVs...)
return l3
}
@@ -292,10 +287,10 @@ func (s *SubTLV) DecodeFromBytes(data []byte) ([]byte, error) {
}
type SRv6InformationSTLV struct {
- SID []byte
- Flags uint8
- EndpointBehavior uint16
- SubSubTLVs []PrefixSIDTLVInterface
+ SID []byte `json:"sid"`
+ Flags uint8 `json:"flags"`
+ EndpointBehavior uint16 `json:"endpoint_behavior"`
+ SubSubTLVs []PrefixSIDTLVInterface `json:"sub_sub_tlvs,omitempty"`
}
// SRv6InformationSubTLV defines a structure of SRv6 Information Sub TLV (type 1) object
@@ -414,9 +409,7 @@ func (s *SRv6InformationSubTLV) Extract() *SRv6InformationSTLV {
SubSubTLVs: make([]PrefixSIDTLVInterface, 0),
}
- for _, tlv := range s.SubSubTLVs {
- info.SubSubTLVs = append(info.SubSubTLVs, tlv)
- }
+ info.SubSubTLVs = append(info.SubSubTLVs, s.SubSubTLVs...)
return info
}