Linux added a new bond transmit hashing policy, VLAN_SRCMAC in [1],
available since Linux 5.12. Add this hashing policy into the respective
data structures.
[1] 7b8fc0103b
- `Rate64` field added to the `Netem` struct in `qdisc.go`
- Implemented serialization and deserialization methods for `Rate64`
- Modify `TestClassAddDel` test to validate Rate64 changes
Linux 5.6 and higher support IFLA_PERM_ADDRESS, which contains the
permanent hardware address of the interface if an interface has such an
address. This can be used to identify interfaces even when the normal
hardware address has been changed.
Signed-off-by: Lorenz Brun <lorenz@monogon.tech>
qdisc statistics is exposed in netlink response but not parsed, here we
parse it and expose it via struct QdiscStatistics.
Signed-off-by: Kangjie Xu <kanxu@ebay.com>
This commit add the support for alternative names.
* exposing the attributes in the link object.
* adding the add and delete functions
* allow LinkByName() to also find devices by altname like `ip link`
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Functions added:
DevlinkGetDeviceParams - get all parameters for device
DevlinkGetDeviceParamByName - get specific parameter for device
DevlinkSetDeviceParam - set parameter for device
Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
This commit added support to allow the operation of ip6tnl encapsulation.
It is equivalent to the iproute2 command, e.g., ip route add 192.168.99.0/24 encap ip6 dst 2001:db8:: dev ip6-tunnel
The limitation include that the options field defined in encap nl route attribute is not implenmented yet.
Testcase is included.
- Update nl package with new netlink attribute types and consts
- Define structs to model devlink device resources
- Add DevlinkGetDeviceResources method to return device resources
- Add basic test
Signed-off-by: adrianc <adrianc@nvidia.com>
certain implementations in kernel return NLMSG_DONE
with no data. If that is the case, assume no error occured.
Signed-off-by: adrianc <adrianc@nvidia.com>
The qdiscPayload() function was missing the TCA_FQ_PLIMIT attribute
for the Fq Qdisc. Therefore, it could not be changed via the library.
Fix this up, so that QdiscReplace() with different qdisc.PacketLimit
works now.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
The xfrm framework is linux-only. Only implement the respective types
for GOOS=linux to avoid dependencies to x/sys/unix on non-linux or
non-unix platforms. Provide dummy XfrmPolicy and XfrmState types for the
globally defined XfrmPolicy* and XfrmState* functions.
With this, the skip message will display the position of the
helper invocation (i.e. the test that caused the skip) instead of the
position of the t.Skip call in minKernelRequired the helper.
TestRouteFilterAllTables and TestRouteExtraFields started failing a
while ago after GitHub actions images bumped the kernel version from
5.15.x to 6.2.x [1].
This is because newer kernels containing commit [2] started rejecting
Tos values with the ECN bits set to non-zero, this leads to the
following error being reported when adding routes:
invalid argument: Invalid dsfield (tos): ECN bits must be 0
Fix this by using a valid Tos value in TestRouteFilterAllTables and
TestRouteExtraFields.
[1] https://github.com/vishvananda/netlink/pull/773#issuecomment-1754436653
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f55fbb6afb8d
This causes the NETLINK_EXT_ACK socket option to be set and extended
error messages to be reported in errors. This should help debug test
failures.
Also use errors.Is to check for errors because using extended error
reporting, the errors no longer match exactly.