From d203dd1b893386dba97845a05369bcc11bc1895a Mon Sep 17 00:00:00 2001 From: Jeroen Simonetti Date: Fri, 10 May 2024 08:59:27 +0200 Subject: [PATCH] Rename CacheInfo Prefered Fix a typo in the CacheInfo struct. Signed-off-by: Jeroen Simonetti --- address.go | 10 +++++----- address_test.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/address.go b/address.go index 8b97f57..d64b6f9 100644 --- a/address.go +++ b/address.go @@ -212,10 +212,10 @@ func (a *AddressAttributes) encode(ae *netlink.AttributeEncoder) error { // CacheInfo contains address information type CacheInfo struct { - Prefered uint32 - Valid uint32 - Created uint32 - Updated uint32 + Preferred uint32 + Valid uint32 + Created uint32 + Updated uint32 } // decode decodes raw bytes into a CacheInfo's fields. @@ -224,7 +224,7 @@ func (c *CacheInfo) decode(b []byte) error { return fmt.Errorf("rtnetlink: incorrect CacheInfo size, want: 16, got: %d", len(b)) } - c.Prefered = nativeEndian.Uint32(b[0:4]) + c.Preferred = nativeEndian.Uint32(b[0:4]) c.Valid = nativeEndian.Uint32(b[4:8]) c.Created = nativeEndian.Uint32(b[8:12]) c.Updated = nativeEndian.Uint32(b[12:16]) diff --git a/address_test.go b/address_test.go index 00aa63d..7dec1de 100644 --- a/address_test.go +++ b/address_test.go @@ -146,10 +146,10 @@ func TestAddressMessageUnmarshalBinary(t *testing.T) { Broadcast: net.IP(nil), Anycast: net.IP(nil), CacheInfo: CacheInfo{ - Prefered: 0xffffffff, - Valid: 0xffffffff, - Created: 0x144, - Updated: 0x144, + Preferred: 0xffffffff, + Valid: 0xffffffff, + Created: 0x144, + Updated: 0x144, }, Multicast: net.IP(nil), Flags: 0x80,