21 Commits

Author SHA1 Message Date
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
Matt Layher
3f746d924b
rtnetlink: support for RTA_PREF (#137)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2022-03-13 18:00:51 +01: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
8d122574c7
rtnetlink: add RouteMetrics.InitRwnd field (#104)
Signed-off-by: Matt Layher <mlayher@fastly.com>
2021-01-22 17:32:28 +01:00
Matt Layher
c676dcb476
rtnetlink: add encodeIP netlink attribute IP address helper (#98)
Signed-off-by: Matt Layher <mlayher@fastly.com>
2021-01-19 16:41:33 +01:00
Matt Layher
057ddd1f37
rtnetlink: implement MPLSNextHop encoding and decoding
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-11-18 15:26:31 -05:00
Matt Layher
d3bfe80807
rtnetlink: invalid rtnexthop length crasher found by go-fuzz
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-11-09 12:12:15 -05:00
Matt Layher
73ac306def
rtnetlink: fix out of bounds route attributes crasher found by go-fuzz
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-11-09 12:09:08 -05:00
Matt Layher
df6d3b58ab
rtnetlink: fix short rtnexthop crasher found by go-fuzz
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-11-09 12:03:59 -05:00
Dave Josephsen
bae80799d8 rtnetlink: complete route multipath encoding and decoding logic
Signed-off-by: Dave Josephsen <djosephsen@fastly.com>
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-10-26 12:43:11 -04:00
Matt Layher
20ab75e733
rtnetlink: perform marshaling round-trip in RouteMessage tests (#84)
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-10-14 09:07:59 +02:00
Matt Layher
9c6f07d100
rtnetlink: full test coverage for RouteMessage/Attributes parsing (#83)
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-10-09 19:07:50 +02:00
Matt Layher
4e9cdead09
rtnetlink: add RouteMetrics nested attributes within RouteAttributes (#81)
Signed-off-by: Matt Layher <mlayher@fastly.com>
2020-10-02 16:52:24 +02: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
Anatole Denis
0b6465fc1b route: Implement support for RTA_EXPIRES
The RTA_EXPIRES attribute allows creating self-deleting routes; it is
useful for example when installing routes obtained from a DHCP lease.

The natural zero-value of the attribute needs special care, since it
means the route will be immediately deleted, a very different behaviour
from when the attribute is omitted (where the rule does never expire).
This means we need to separate these cases, which we do by using a
*uint32, where the nil value means the attribute is omitted and any
other values are passed as-is

Signed-off-by: Anatole Denis <anatole@unverle.fr>
2019-10-04 11:32:52 +02:00
Andrea Barberio
0951830968 [route] Revert #27
In #27 I erroneously computed SrcLen and DstLen believing that it was
the octet-length of the Src and Dst addresses in the attributes. This is
actually the prefix length of Src and Dst, which should be set
independently. Also updated comments to reflect this.

Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-11 19:44:31 +01:00
Jeroen Simonetti
b0ae3d1ffc route: remove constants 2019-04-10 17:18:07 +02:00
Jeroen Simonetti
5fefddd5d6 address: remove constants 2019-04-10 17:17:00 +02:00
Andrea Barberio
fcb754f111 [route] Explicitly set SrcLen and DstLen
Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-10 14:59:34 +01: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