History log of /freebsd-current/tests/sys/netlink/test_rtnl_iface.py
Revision Date Author Comments
# 2d49ff1e 18-Oct-2023 Gleb Smirnoff <glebius@FreeBSD.org>

tests/netlink: mark the vlan(4) test with required module


# 089104e0 18-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: add netlink interfaces to if_clone

This change adds netlink create/modify/dump interfaces to the `if_clone.c`.
The previous attempt with storing the logic inside `netlink/route/iface_drivers.c`
did not quite work, as, for example, dumping interface-specific state
(like vlan id or vlan parent) required some peeking into the private interfaces.

The new interfaces are added in a compatible way - callers don't have to do anything
unless they are extended with Netlink.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D39032
MFC after: 1 month


# fee65b7e 31-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

tests: split netlink.py into multiple files to impove maintainability.

This diff does not contain any functional changes.
Its sole purpose is splitting netlink.py into smaller chunks.
The new code simplifies the upcoming generic netlink support
introduction.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D39365


# ce9f95bd 03-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: fix vlan interface creation

MFC after: 2 weeks


# 79748cec 18-Feb-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

tests: fix netlink test_dump_ifaces_many test.

Consider only loopback interfaces when counting.
Otherwise, if pf is loaded, 'pflog0' gets added to the vnet,
breaking the test.

MFC after: 2 weeks


# 86fd0bdb 16-Feb-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: fix interface dump.

The current code missed interface addition when reallocating
temporary buffer.
Tweak the code to perform the reallocation first and add
interface afterwards unconditionally.

Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after: 3 days


# 25c2dd2f 09-Feb-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: return optional metadata with the operation result.

Some operations like interface creation may need to return metadata
- in this case, interface name - back to the caller if the operation
is successful.
This change implements attaching an `NLMSGERR_ATTR_COOKIE` nla to the
operation reply message via `nlmsg_report_cookie()`.
Additionally, on successful interface creation, interface index and
interface name are returned in the `IFLA_NEW_IFINDEX` and `IFLA_IFNAME
TLVs, encapsulated in the `NLMSGERR_ATTR_COOKIE`.

Reviewed By: pauamma
Differential Revision: https://reviews.freebsd.org/D38283
MFC after: 1 week


# 9408f366 08-Jan-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

testing: fix skipping netlink tests if netlink module is not loaded.


# c1871a33 07-Jan-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: improve RTM_GETADDR handling.

* Allow filtering by ifa_family & ifa_index.
* Add common RTM_<NEW|DEL|GET>ADDR parser
* Add tests verifying RTM_GETADDR filtering behaviour & output
* Factor out common netlink socket test methods into NetlinkTestTemplate
* Add NLMSG_DONE message handler

Reviewed By: pauamma
Differential Revision: https://reviews.freebsd.org/D37970


# 3873bdc2 15-Dec-2022 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: connect netlink tests to the build

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D37708


# 80f03e63 14-Dec-2022 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: improve interface handling

* Separate interface creation from interface modification code
* Support setting some interface attributes (ifdescr, mtu, up/down, promisc)
* Improve interaction with the cloners requiring to parse/write custom
interface attributes
* Add bitmask-based way of checking if the attribute is present in the
message
* Don't use multipart RTM_GETLINK replies when searching for the
specific interface names
* Use ENODEV instead of ENOENT in case of failed RTM_GETLINK search
* Add python netlink test helpers
* Add some netlink interface tests

Differential Revision: https://reviews.freebsd.org/D37668