History log of /freebsd/sys/netlink/netlink_message_parser.c (Results 1 – 17 of 17)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# e453e498 11-Jun-2025 Brooks Davis <brooks@FreeBSD.org>

machine/stdarg.h -> sys/stdarg.h

Switch to using sys/stdarg.h for va_list type and va_* builtins.

Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is eas

machine/stdarg.h -> sys/stdarg.h

Switch to using sys/stdarg.h for va_list type and va_* builtins.

Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.

Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595

show more ...


Revision tags: release/14.3.0, release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7
# 876b88a4 29-Jan-2025 Gleb Smirnoff <glebius@FreeBSD.org>

netlink: consistently use unsigned types in the parser

Use uint32_t for anything that is derived from message length, use
uint16_t for anything that represents attribute length and use u_int for
arr

netlink: consistently use unsigned types in the parser

Use uint32_t for anything that is derived from message length, use
uint16_t for anything that represents attribute length and use u_int for
array indices.

show more ...


Revision tags: release/14.2.0-p1, release/13.4.0-p3
# 810c1226 29-Jan-2025 Gleb Smirnoff <glebius@FreeBSD.org>

netlink: use u_int as argument for ifnet_byindex()


# 8b094a98 29-Jan-2025 Gleb Smirnoff <glebius@FreeBSD.org>

netlink: style(9) pass over message parsing code

Mostly breaking long lines, few other changes.


Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# dfed87b5 26-Feb-2024 Kristof Provost <kp@FreeBSD.org>

netlink: add bool type support

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44089


# 48f33b55 26-Feb-2024 Kristof Provost <kp@FreeBSD.org>

netlink: fix casts

Reviewed by: melifaro
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44088


# 66d77e0f 18-Dec-2023 Igor Ostapenko <pm@igoro.pro>

netlink: fix debug text typo in message parser

Signed-off-by: Igor Ostapenko <pm@igoro.pro>
Pull-request: https://github.com/freebsd/freebsd-src/pull/942


Revision tags: release/14.0.0
# 1c5c7e61 14-Oct-2023 Kristof Provost <kp@FreeBSD.org>

netlink: add attr parser utility functions

- nlattr_get_chara() to read a string into a char array, rather than to a char *
- nlattr_get_bytes() to read an arbitrary (fixed length) byte sequence

netlink: add attr parser utility functions

- nlattr_get_chara() to read a string into a char array, rather than to a char *
- nlattr_get_bytes() to read an arbitrary (fixed length) byte sequence
- nlattr_get_nested_ptr() to read a nested type to a struct foo *, rather than struct foo

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42221

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# fa554de7 11-May-2023 Kristof Provost <kp@FreeBSD.org>

netlink: reduce default log levels

Reduce the default log level for netlink to LOG_INFO. This removes a
number of messages such as

> [nl_iface] dump_sa: unsupported family: 0, skipping
or
> [nl_ifa

netlink: reduce default log levels

Reduce the default log level for netlink to LOG_INFO. This removes a
number of messages such as

> [nl_iface] dump_sa: unsupported family: 0, skipping
or
> [nl_iface] get_operstate_ether: error calling SIOCGIFMEDIA on vlan0: 22

that are useful for debugging, but not for most users.

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40062

show more ...


# 70810dc8 25-Apr-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: add nlattr_get_uint8() function to pack u8 attributes.

MFC after: 2 weeks


Revision tags: release/13.2.0
# 13781800 15-Mar-2023 Kristof Provost <kp@FreeBSD.org>

carp: support unicast

Allow users to configure the address to send carp messages to. This
allows carp to be used in unicast mode, which is useful in certain
virtual configurations (e.g. AWS, VMWare

carp: support unicast

Allow users to configure the address to send carp messages to. This
allows carp to be used in unicast mode, which is useful in certain
virtual configurations (e.g. AWS, VMWare ESXi, ...)

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D38940

show more ...


# 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

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

show more ...


# 10f2a387 21-Jan-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: fix OOB write when creating attribute bitmask.

Fix wrong arithmetics by moving to the standard bitset(9) functions.

Reported by: markj, KASAN


# 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

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

show more ...


Revision tags: release/12.4.0, release/13.1.0
# 7e5bf684 20-Jan-2022 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: add netlink support

Netlinks is a communication protocol currently used in Linux kernel to modify,
read and subscribe for nearly all networking state. Interfaces, addresses, routes,
firew

netlink: add netlink support

Netlinks is a communication protocol currently used in Linux kernel to modify,
read and subscribe for nearly all networking state. Interfaces, addresses, routes,
firewall, fibs, vnets, etc are controlled via netlink.
It is async, TLV-based protocol, providing 1-1 and 1-many communications.

The current implementation supports the subset of NETLINK_ROUTE
family. To be more specific, the following is supported:
* Dumps:
- routes
- nexthops / nexthop groups
- interfaces
- interface addresses
- neighbors (arp/ndp)
* Notifications:
- interface arrival/departure
- interface address arrival/departure
- route addition/deletion
* Modifications:
- adding/deleting routes
- adding/deleting nexthops/nexthops groups
- adding/deleting neghbors
- adding/deleting interfaces (basic support only)
* Rtsock interaction
- route events are bridged both ways

The implementation also supports the NETLINK_GENERIC family framework.

Implementation notes:
Netlink is implemented via loadable/unloadable kernel module,
not touching many kernel parts.
Each netlink socket uses dedicated taskqueue to support async operations
that can sleep, such as interface creation. All message processing is
performed within these taskqueues.

Compatibility:
Most of the Netlink data models specified above maps to FreeBSD concepts
nicely. Unmodified ip(8) binary correctly works with
interfaces, addresses, routes, nexthops and nexthop groups. Some
software such as net/bird require header-only modifications to compile
and work with FreeBSD netlink.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36002
MFC after: 2 months

show more ...