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>
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>
Ip6tnl devices support IFLA_IPTUN_COLLECT_METADATA (collect_md/external
mode). This commit adds support for this and a respective test.
Signed-off-by: Robin Gögge <r.goegge@isovalent.com>
Add two new methods to allow setting GSO and GRO max size attributes only.
They make it much easier to enable IPv4 BIG TCP [0].
The equivalent iproute2 commands are:
$ ip link set $link gso_ipv4_max_size $maxSize
$ ip link set $link gro_ipv4_max_size $maxSize
Also add tests for them. We already do support the IPv6 counterpart via
543bb1cade ("link: add LinkSetGSOMaxSize and LinkSetGROMaxSize").
[0] https://lore.kernel.org/netdev/cover.1674921359.git.lucien.xin@gmail.com/
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This pr allows to change the default vlan on a bridge. It is
currently set to 1 by default. A value of 0 means no default vlan.
Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
GRE L3 devices support "FlowBased" ("collect_md"/"external") mode.
Add support for this configuration and relevant test.
Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Add support for the new IFLA_GRO_MAX_SIZE attribute which is needed to
enable BIG TCP[1] properly. Define the attribute in the local link
attributes (nl/link_linux.go) because it isn't yet present in Go's
x/sys/unix package. Also add a test for it.
[1] https://patchwork.kernel.org/project/netdevbpf/cover/20220513183408.686447-1-eric.dumazet@gmail.com/
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Provide the status of the allmulticast option via the highlevel
link attributes instead of requiring raw flag handling.
Avoid comparing all rawflags before and after in tests due to that
the IFF_RUNNING flag might change independenly.
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
ipvtap is a similar link type as ipvlan with tap interface.
This patch enables it just like macvtap.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Creating a veth pair across namespaces now is a multistep process.
Doing it in one shot with this change is clearer as current
namespace never sees peer IF. Also, moving peer into a namespace
may be rather slow, so better avoided.
When deserializing a link related netlink message, if no network namespace id
attribute is specified, we need to set it to -1 otherwise it defaults to 0
which is a valid id. Using NewLinkAttrs sets the default values and allows
the user to distinguish an empty value from a missing value
This PR refers to PR@lebauce and add some changes.
- Added some tests to retrieve bond slave information.
- Link.BondSlave is changed to LinkSlave interface.
- BondSlaveState.String() returns UPPER case. (same as iproute2)
- BondSlaveMiiStatus.String() returns UPPER case. (same as iproute2)
- Add a new Link type, IPoIB, that exposes the following IPoIB attributes:
* IFLA_IPOIB_PKEY
* IFLA_IPOIB_MODE
* IFLA_IPOIB_UMCAST
- Suppport Deserialize for IPoIB link attributes in LinkDeserialize()
- Support IPoIB attributes in LinkAdd()
Today netlink package supports Get/Set of a VF's max TX rate
via IFLA_VF_TX_RATE netlink attribute.
This patch add support to Get/Set of a VFs min and max TX rate
via IFLA_VF_RATE netlink attribute.
- Add support to set min/max tx rate for VF via IFLA_VF_RATE
- Added IFLA_VF_RATE min/max tx rate attributes to netlink.VfInfo
including parsing support in netlink.parseVfInfo()
NOTE: According to [1] IFLA_VF_RATE takes precedence over
IFLA_VF_TX_RATE. Dealing with the co-existance of these
netlink attributes is left for the user to handle.
[1]https://lists.openwall.net/netdev/2014/05/22/42
For tuntap interfaces, return a TunTap Interface instead of
a Generic link when retrieving the interface.
Use netlink extended attributes to populate the Link attributes
for the tuntap link.
In case of older tun driver which does not provide these
attributes, use sysfs to retrieve these attributes.
This commit also adds Owner and Group attributes for the TunTap
Link.
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
XFRM interfaces are available in Linux Kernel 4.19+
When an IF_ID is applied to a XFRM policy and state, the corresponding
traffic will be sent through the virtual interface with the same IF_ID.
chg: addtl comment and made minor logic optimization as disscussed in PR #296
chg: flipped Persist to NonPersist
chg: comments, only unpersist tuntap if flag is set
chg: tuntap persist optional, allow empty intfc name
chg: added conditional build
Signed-off-by: Ralph Schmieder <ralph.schmieder@gmail.com>