Skip to content

Commit

Permalink
Rename CacheInfo Prefered
Browse files Browse the repository at this point in the history
Fix a typo in the CacheInfo struct.

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
  • Loading branch information
jsimonetti committed May 10, 2024
1 parent e363a19 commit d203dd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions address.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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])
Expand Down
8 changes: 4 additions & 4 deletions address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d203dd1

Please sign in to comment.