netlink: Add tests when adding an interface routeAdd tests for adding a route using an interface only (without an IPaddress).Reviewed by: rcmApproved by: kp (mentor)MFC after: 1 weekDifferent
netlink: Add tests when adding an interface routeAdd tests for adding a route using an interface only (without an IPaddress).Reviewed by: rcmApproved by: kp (mentor)MFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D41436(cherry picked from commit 1db64f89363c97858961c4df0b7d02f3223723cf)
show more ...
netlink: cope with growing requestsIf a request ends up growing beyong the initially allocated space thenetlink functions (such as snl_add_msg_attr_u32()) will allocate anew buffer. This invalida
netlink: cope with growing requestsIf a request ends up growing beyong the initially allocated space thenetlink functions (such as snl_add_msg_attr_u32()) will allocate anew buffer. This invalidates the header pointer we can have receivedfrom snl_create_msg_request(). Always use the hdr returned bysnl_finalize_msg().Reviewed by: melifaroMFC after: 1 weekSponsored by: Rubicon Communications, LLC ("Netgate")Differential Revision: https://reviews.freebsd.org/D42223(cherry picked from commit 4f8f43b06ed07e96a250855488cc531799d5b78f)
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
netlink: fix failing TestRtNlAddIfaddrLo::test_add_6 tests.Recent netlink commit added hook for calling IPv6 code upon implicitinteface bring-up on adding first interface address. This hook handle
netlink: fix failing TestRtNlAddIfaddrLo::test_add_6 tests.Recent netlink commit added hook for calling IPv6 code upon implicitinteface bring-up on adding first interface address. This hook handleslink-local ifa addition for the loopback interface, resulting infailed assertion in the loopback tests.Fix the tests by fixing the assert.
netlink: use netlink mbufs in the mbuf chains.Continue D40356 and switch the remaining parts of mbuf-relatedcode to the Netlink mbufs.Reviewed By: gallatinDifferential Revision: https://reviews
netlink: use netlink mbufs in the mbuf chains.Continue D40356 and switch the remaining parts of mbuf-relatedcode to the Netlink mbufs.Reviewed By: gallatinDifferential Revision: https://reviews.freebsd.org/D40368MFC after: 2 weeks
netlink: add snl(3) support for listing genetlink multicast groupsReviewed by: baptDifferential Revision: https://reviews.freebsd.org/D40282MFC after: 2 weeks
netlink: automatically generate broadcast for IPv4 ifa if not set.MFC after: 2 weeks
netlink: add support for adding/deleting interface addressesDifferential Revision: https://reviews.freebsd.org/D40103MFC after: 2 weeks
testing: rename IfattrType to IfaAttrType for consistencyAll other attribute classes are named as 'type'AttrType and 'type' int this case is ifa (interface address).MFC after: 2 weeks
netlink: temporary skip snl(3) capped test.
netlink: add netlink interfaces to if_cloneThis change adds netlink create/modify/dump interfaces to the `if_clone.c`.The previous attempt with storing the logic inside `netlink/route/iface_driver
netlink: add netlink interfaces to if_cloneThis 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 anythingunless they are extended with Netlink.Reviewed by: kpDifferential Revision: https://reviews.freebsd.org/D39032MFC after: 1 month
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 s
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 supportintroduction.MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D39365
netlink: fix capped uncapped ack handling in snl(3).Reviewed by: kpDifferential Revision: https://reviews.freebsd.org/D39144MFC after: 2 weeks
netlink: improve snl(3)Summary:* add snl_send_message() as a convenient send wrapper* add signed integer parsers* add snl_read_reply_code() to simplify operation result checks* add snl_read_rep
netlink: improve snl(3)Summary:* add snl_send_message() as a convenient send wrapper* add signed integer parsers* add snl_read_reply_code() to simplify operation result checks* add snl_read_reply_multi() to simplify reading multipart messages* add snl_create_genl_msg_request()* add snl_get_genl_family() to simplify family name->id resolution* add tests for some of the functionalityReviewed by: kpDifferential Revision: https://reviews.freebsd.org/D39092MFC after: 2 weeks
netlink: add snl(3) default parsers for routes and links.This change adds the "default" parsers of _all_ route/link attributes exported by the kernel.It removes the need to declare similar parser
netlink: add snl(3) default parsers for routes and links.This change adds the "default" parsers of _all_ route/link attributes exported by the kernel.It removes the need to declare similar parsers in the userland applications, simplifying their logic.Differential Revision: https://reviews.freebsd.org/D38979MFC after: 2 weeks
tests: add more netlink tests for neighbors/routesDifferential Revision: https://reviews.freebsd.org/D38912MFC after: 2 weeks
netlink: fix vlan interface creationMFC after: 2 weeks
tests: add netlink large dump buffer checkDifferential Revision: https://reviews.freebsd.org/D38665MFC after: 2 weeks
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
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 unconditio
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 <[email protected]>MFC after: 3 days
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
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 theoperation 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: pauammaDifferential Revision: https://reviews.freebsd.org/D38283MFC after: 1 week
netlink: allow creating sockets with SOCK_DGRAM.Some existing applications setup Netlink socket withSOCK_DGRAM instead of SOCK_RAW. Update the manpage to clarifythat the default way of creating t
netlink: allow creating sockets with SOCK_DGRAM.Some existing applications setup Netlink socket withSOCK_DGRAM instead of SOCK_RAW. Update the manpage to clarifythat the default way of creating the socket should be withSOCK_RAW. Update the code to support both SOCK_RAW and SOCK_DGRAM.Reviewed By: pauammaDifferential Revision: https://reviews.freebsd.org/D38075
netlink: fix compatibility with older netlink applications.Some apps try to provide only the non-zero part of the required message header instead of the full one. It happens when fetching routes o
netlink: fix compatibility with older netlink applications.Some apps try to provide only the non-zero part of the required message header instead of the full one. It happens when fetching routes or interface addresses, where the first header byte is the family.This behavior is "illegal" under the "strict" Netlink socket option, however there are many applications out there doing things in the "old" way.Support this usecase by copying the provided bytes into the temporary zero-filled header and running the parser on this header instead.Reported by: Goran Mekić <[email protected]>
testing: fix skipping netlink tests if netlink module is not loaded.
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
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 handlerReviewed By: pauammaDifferential Revision: https://reviews.freebsd.org/D37970
12