Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
---
|
||||
linters:
|
||||
enable:
|
||||
- gofmt
|
||||
- misspell
|
||||
- revive
|
||||
|
||||
linters-settings:
|
||||
misspell:
|
||||
ignore-words:
|
||||
# Incorrect spelling used in CacheInfo struct.
|
||||
- Prefered
|
||||
revive:
|
||||
rules:
|
||||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
|
||||
- name: unused-parameter
|
||||
severity: warning
|
||||
disabled: true
|
||||
+1
-1
@@ -165,7 +165,7 @@ func (l *LinkService) Get(index uint32) (LinkMessage, error) {
|
||||
// RTM_SETLINK because:
|
||||
// - using RTM_SETLINK is actually an old rtnetlink API, not supporting most
|
||||
// attributes common today
|
||||
// - using RTM_NEWLINK is the prefered way to create AND update links
|
||||
// - using RTM_NEWLINK is the preferred way to create AND update links
|
||||
// - RTM_NEWLINK is backward compatible to RTM_SETLINK
|
||||
func (l *LinkService) Set(req *LinkMessage) error {
|
||||
flags := netlink.Request | netlink.Acknowledge
|
||||
|
||||
-10
@@ -13,9 +13,6 @@ import (
|
||||
var (
|
||||
// errInvalidNeighMessage is returned when a LinkMessage is malformed.
|
||||
errInvalidNeighMessage = errors.New("rtnetlink NeighMessage is invalid or too short")
|
||||
|
||||
// errInvalidNeighMessageAttr is returned when neigh attributes are malformed.
|
||||
errInvalidNeighMessageAttr = errors.New("rtnetlink NeighMessage has a wrong attribute data length")
|
||||
)
|
||||
|
||||
var _ Message = &NeighMessage{}
|
||||
@@ -185,10 +182,6 @@ func (a *NeighAttributes) decode(ad *netlink.AttributeDecoder) error {
|
||||
case unix.NDA_UNSPEC:
|
||||
// unused attribute
|
||||
case unix.NDA_DST:
|
||||
l := len(ad.Bytes())
|
||||
if l != 4 && l != 16 {
|
||||
return errInvalidNeighMessageAttr
|
||||
}
|
||||
a.Address = ad.Bytes()
|
||||
case unix.NDA_LLADDR:
|
||||
// Allow IEEE 802 MAC-48, EUI-48, EUI-64, or 20-octet
|
||||
@@ -198,9 +191,6 @@ func (a *NeighAttributes) decode(ad *netlink.AttributeDecoder) error {
|
||||
// Ignore empty addresses.
|
||||
continue
|
||||
}
|
||||
if l != 6 && l != 8 && l != 20 {
|
||||
return errInvalidNeighMessageAttr
|
||||
}
|
||||
a.LLAddress = ad.Bytes()
|
||||
case unix.NDA_CACHEINFO:
|
||||
a.CacheInfo = &NeighCacheInfo{}
|
||||
|
||||
Reference in new issue
Block a user