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>
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>
Allows enslaving ifaces to bridges.
Required the change to make MTU an optional attr to prevent EINVAL from the kernal. If we need to support setting the MTU to 0, the field will have to be a ptr on the LinkAttribute struct.
Fixes#18
When marshaling a LinkMessage the default values for LinkAttributes
causes netlink errors. By using a pointer to check if
LinkAttributes are set or not and only marshaling them if not nil
we prevent causing these errors.
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
So far the LinkMessage.Change field was unused and recommended to be set
to 0xffffffff. This field is actually necessary to change specific flags.
Signed-off-by: Andrea Barberio <insomniac@slackware.it>
Add support for parsing two additional LinkAttributes necessary for
creating and managing interfaces: OperationState and LinkInfo.
OperationalState allows for the UP/DOWN state of the interface to be
determined and controlled. This addition allows for interfaces to be
created and then brought up programatically.
LinkInfo contains driver specific configuration, such as those for
bridges or tunnels. This additional configuration is stored as nested
Netlink messages on the Data and SlaveData members.
Loosen the LinkAttribute length checks, to parse links that store
information other than MAC addresses in the Address or Broadcast fields.
This change, for example, now allows IPIP, GRE over IP, 6to4, and IP
over Infiniband.
The fields continue to be net.HardwareAddr, which may result in slightly
unusual representations when printed as a string. This type can be cast
to other byte slice types by users, if necessary.
Fix: #7