13 Commits

Author SHA1 Message Date
Daniel Swarbrick
f8dffafbb8
Use golang.org/x/sys/cpu.IsBigEndian (#273)
github.com/mdlayher/netlink v1.8.0 changed the return of
nlenc.NativeEndian() such that comparing it against encoding.BigEndian
or encoding.LittleEndian does not work as expected.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2025-08-26 19:57:38 +02:00
Ben Kochie
8026e5db33
Fix Go mod path (#226)
In order to update to v2.0.0, we need to update the module path per the
Go module documentation.
* https://go.dev/doc/modules/major-version

Fixes: https://github.com/jsimonetti/rtnetlink/issues/225

This can be released as v2.0.1

Signed-off-by: SuperQ <superq@gmail.com>
2024-05-10 16:40:56 +02:00
Jeroen Simonetti
61ed88fc1e
Rename CacheInfo Prefered (#224)
Fix a typo in the CacheInfo struct.

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2024-05-10 09:01:40 +02:00
James Tucker
d380b50506
rtnetlink: add address label encoding (#138)
Signed-off-by: James Tucker <jftucker@gmail.com>
2022-04-08 16:16:09 -04:00
Matt Layher
4cc3c14895
rtnetlink: tidy IP address encoding/decoding, fix attribute error handling (#125)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-07-21 22:56:14 +02:00
Matt Layher
af39de65d6
rtnetlink: make AddressMessage.Attributes optional via pointer (#124)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-07-14 15:52:44 +02:00
Jeroen Simonetti
31febcbb33
Change address message to ignore empty ip's (#74)
This will not marshal the following attributes when empty:
- Local (was already ignored)
- Broadcast
- Anycast
- Multicast

Fixes: #73

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2020-03-19 15:28:06 +01:00
Florian Lehner
d21b2cb70d resolve GOOS dependency (#63)
* resolve GOOS dependency

Signed-off-by: Lehner Florian <dev@der-flo.net>

* exclude internal constants from linter

Signed-off-by: Lehner Florian <dev@der-flo.net>
2019-10-19 19:25:34 +02:00
Jeroen Simonetti
51db9f1201
Skip tests on big-endian systems (#62)
To prevent having to maintain byte slices for both endian types
in our tests, we skip tests when running on big-endian systems.

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2019-10-09 19:23:56 +02:00
Ryan Whelan
4d6cd27f32 fix: Null ifaLocal causes error from kernel (#19)
* fix: Null ifaLocal causes error from kernel

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2019-04-10 18:41:15 +02:00
Jeroen Simonetti
5fefddd5d6 address: remove constants 2019-04-10 17:17:00 +02:00
Ryan Whelan
192bbe2104 Basic RouteService (#12)
* Basic RouteService

* Netlink header flag name changed in netlink lib

* Add fallthrough for RTM_GETROUTE and RTM_DELROUTE message parsing

* RouteService tests

* Update conn_test to use new netlink header flag names

* Fix off-by-one bug in AddressMessage.UnmarshalBinary()

* Update address test for off-by-one bug in AddressMessage.UnmarshalBinary()

* Fix case statement in messageUnmarshall
2019-03-27 13:47:19 +01:00
Jeroen Simonetti
799b64bcf8 address: Implement Address service 2017-01-19 10:43:01 +01:00