This allows to set route priority/metric for prefix routes created
automatically when an address is assigned.
E.g. `10.0.0.0/8` with metric `32` would generate a route:
```
10.0.0.0/8 via <if> metric 32
```
The default metric is zero. A custom metric allows to prefer
one interface over another when the prefixes overlap.
See https://github.com/siderolabs/talos/issues/10696
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
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>
Use netlink attribute en-/decoder infrastructure
This should pave the way for endian aware code.
Ref #56
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
Breaking change.
Because deleting an address requires more information then was
available we allow for users to construct the request message.
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
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>
* 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