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,