mirror of https://github.com/jetkvm/kvm.git
fix(lldp): golangci-lint issues
This commit is contained in:
parent
826e5155b2
commit
1e5184284f
|
|
@ -30,7 +30,7 @@ type Neighbor struct {
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NeighborSourceLLDP uint8 = 0x1
|
NeighborSourceLLDP uint8 = 0x1
|
||||||
NeighborSourceCDP = 0x2
|
NeighborSourceCDP uint8 = 0x2
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ func (l *LLDP) stopCapture() error {
|
||||||
// write an empty packet to the TPacketRx to interrupt the blocking read
|
// write an empty packet to the TPacketRx to interrupt the blocking read
|
||||||
// it's a shitty workaround until https://github.com/google/gopacket/pull/777 is merged,
|
// it's a shitty workaround until https://github.com/google/gopacket/pull/777 is merged,
|
||||||
// or we have a better solution, see https://github.com/google/gopacket/issues/1064
|
// or we have a better solution, see https://github.com/google/gopacket/issues/1064
|
||||||
l.tPacketRx.WritePacketData([]byte{})
|
_ = l.tPacketRx.WritePacketData([]byte{})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// wait for the goroutine to finish
|
// wait for the goroutine to finish
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ func tlvMgmtAddress(m *layers.LLDPMgmtAddress) layers.LinkLayerDiscoveryValue {
|
||||||
|
|
||||||
func checkLLDPTLVLen(v layers.LinkLayerDiscoveryValue, l int) (err error) {
|
func checkLLDPTLVLen(v layers.LinkLayerDiscoveryValue, l int) (err error) {
|
||||||
if len(v.Value) < l {
|
if len(v.Value) < l {
|
||||||
err = fmt.Errorf("invalid TLV %v length %d (wanted mimimum %v)", v.Type, len(v.Value), l)
|
err = fmt.Errorf("invalid TLV %v length %d (wanted minimum %d)", v.Type, len(v.Value), l)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue