| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
https://github.com/thom311/libnl/pull/409
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/406
|
| |
| |
| |
| | |
Add support for the IFLA_BR_MULTI_BOOLOPT bridge link attribute.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for the following attributes for bridge links:
IFLA_BR_STP_STATE
IFLA_BR_MCAST_ROUTER
IFLA_BR_MCAST_SNOOPING
|
| |
| |
| |
| |
| |
| | |
There are bridge info setter functions for nf_call_iptables,
nf_call_ip6tables and nf_call_arptables, but no corresponding getter
functions, so add them.
|
|/
|
|
|
| |
A corresponding entry for rtnl_link_bridge_set_vlan_default_pvid is
missing from the libnl-route-3.sym file, so add it.
|
|
|
|
|
|
|
|
|
|
| |
The amount of flags that could be stored in the ndm_flags field of ndmsg
was limited to 8, so the kernel introduced a new attribute so more flags
could be represented in netlink messages.
Add support for the extended neighbour flags.
https://github.com/thom311/libnl/pull/405
|
|
|
|
| |
https://github.com/thom311/libnl/pull/404
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the following bridge flags:
IFLA_BRPORT_PROXYARP
IFLA_BRPORT_PROXYARP_WIFI
IFLA_BRPORT_MCAST_FLOOD
IFLA_BRPORT_MCAST_TO_UCAST
IFLA_BRPORT_VLAN_TUNNEL
IFLA_BRPORT_BCAST_FLOOD
IFLA_BRPORT_NEIGH_SUPPRESS
IFLA_BRPORT_ISOLATED
IFLA_BRPORT_LOCKED
IFLA_BRPORT_MAB
IFLA_BRPORT_NEIGH_VLAN_SUPPRESS
https://github.com/thom311/libnl/pull/403
|
| |
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/402
|
| |
| |
| |
| |
| |
| |
| |
| | |
Analogue to the change for cache_include(), use the new helper for
nl_objects and initialize old to NULL since we do not use it for other
messages than XFRM_MSG_EXPIRE.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Use the new _nl_auto_nl_object helper for cache where appropriate. Make
sure to initialze *old to NULL in cache_include() as we do not
initialize it in the error path for unknown actions.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
|/
|
|
|
|
| |
Add a helper for automatically cleaning up a nl_object reference.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
|
|
|
| |
Fixes: 298ee58e7a84 ('python add "pyproject.toml" for configuring black')
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/401
|
| |
| |
| |
| |
| |
| |
| | |
Now that we can compare and clone, we can implement parsing bond type
links. Add parsing for all supported types.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
| |
| |
| |
| |
| |
| | |
Implement comparing two bond links to know if their attributes changed.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
| |
| |
| |
| |
| |
| |
| | |
Implement the missing rtnl_link_info_ops::io_clone(), so that cloning a
bond link will retain its data.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
| |
| |
| |
| |
| |
| |
| | |
In preparation of parsing bond link attributes, add getters for all
supported attributes.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
|/
|
|
|
|
| |
rename bn_mask to ce_mask to allow the use of attr macros.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
|
|
|
|
| |
through permutations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_nltst_assert_route_list() compares the content of the cache with a list
of expected routes.
The cache does not have a well defined order.
Well, maybe the cache *should* have a well defined order, because when
we use `ip route replace`, it will replace some route that has certain
similar attributes, but is otherwise another route (as far as route
identity and caching is concerned). But on netlink, we are only told
that one route was replaced, but not which one. Some kernel developers
think that in face of that, we just iterate the cache (in the same order
as kernel exports the route), find the first similar route and know that
was the one that is replaced. Does that work? Dunno, I never saw anybody
implementing that successfully. NetworkManager implements a similar
cache and throws it's hands in the air and requests a new dump of all
routes that it caches.
Anyway. Unless somebody shows that the cache is always in a consistent and
reproducible state, this unit test was wrong.
Instead, permutate through all lists of routes, and try to find a
one-to-one match with the expected routes.
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
It's hard to debug a failure. Print what we were comparing before
crashing.
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling release_link_info() will call io_free() for rtnl_link::l_info
was allocated just a few lines before as a side effect of
rtnl_link_set_type().
Apart from doing needless memory churn, this will also leave the link
with l_info set to NULL if the link type does not provide a io_parse()
function.
Assuming the memory leak mentioned in bfee88b8b0a9 ("route: fix memory
leak of l_info_ops in link_msg_parser()") was a double reference taken
by calling rtnl_link_info_ops_lookup() twice, once via
rtnl_link_set_type(), and once directly, replace the lookup() /
release() lookup() with a single lookup() and then reuse the populated
rtnl_link::l_info_ops pointer.
Fixes: bfee88b8b0a9 ("route: fix memory leak of l_info_ops in link_msg_parser()")
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
https://github.com/thom311/libnl/pull/396
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/398
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The NLA_{UINT|SINT} attributes are introduced for variable-length
integers, whose length are 32bits or 64bits.
So add appropriate functions to get or put NLA_{UINT|SINT} attributes.
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
|
|/
|
|
|
|
|
|
|
| |
The NLA_{SINT|UINT} were introduced to kernel (see [1]). So add the
corresponding enum value to attr.h.
[1] https://lore.kernel.org/r/20231018213921.2694459-3-kuba@kernel.org/
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
|
| |
|
|
|
|
|
|
| |
./python/netlink/route/tc.py:599:37: C408 Unnecessary dict call - rewrite as a literal.
./python/netlink/route/tc.py:610:16: C416 Unnecessary list comprehension - rewrite using list().
./python/netlink/util.py:106:47: C408 Unnecessary dict call - rewrite as a literal.
|
|
|
|
|
|
|
|
| |
Seems recent asciidoc leave us with an empty "libnl.dict".
This breaks the script.
It's not clear to me, why this happens, or why we need to LINK_DOC
at all. Just work around it, so it no longer crashes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On some systems, the clock is reset, or is lost, so the value returned
by the time function can be a very small value. In that case, the
_badrandom_from_time function returns a large value close to the
maximum unsigned int value for s_seq_next. This can lead to the value
wrapping around fairly quickly.
When compiling the library with the unsigned-integer-overflow sanitizer
enabled, this causes an abort.
Detect this potential wrap around condition and avoid it.
https://github.com/thom311/libnl/pull/395
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't define _GNU_SOURCE on the command line. Instead, use
AC_USE_SYSTEM_EXTENSIONS which embeds it in "include/config.h".
Also, fix flex files to ensure "include/config.h" is included as first,
and that we get _GNU_SOURCE defined before including anything else. This
is achieved by include "include/nl-default.h" as %top{}.
|
|
|
|
|
|
|
|
|
| |
These defines should be defined at one place ("defines_cppflags")
and they should be available the same throughout the source code.
Even if PKGLIBDIR is only used by "src/lib/utils.c", there is no harm
in defining it for all compilation units. The point is that it is only
defined at one place and the same for all compilation units.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optimally, ./configure defines things in include/config.h. However,
that does not work well with defines that contain path names (see [1]).
Continue to use "-D" command line option. However, factor out the
definition to one place.
Also, rename from SYSCONFDIR to _NL_SYSCONFDIR_LIBNL.
Note that "src_lib_libnl_cli_3_la_CPPFLAGS" defined to
-DSYSCONFDIR=\"$(sysconfdir)\", without the "libnl" subdirectory. In
this case, the define was never used. The change doesn't matter.
[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
|
|
|
|
| |
This warning does not seem to be triggered. Don't needlessly disable it.
|
|
|
|
|
| |
Instead of having those flags on only in the build script of github CI,
add them to the default flags in "Makefile.am".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nla_len() has no valid reason to fail or return a negative number.
Callers are not allowed to call this on an invalid structure. They
usually would call nla_validate() first.
However, as it returns a signed "int", coverity assumes that in some
cases the value could be negative. That results in coverity warning like
Error: INTEGER_OVERFLOW (CWE-190):
libnl-3.9.0/lib/route/nh.c:339: tainted_data_return: Called function "nla_len(tb[NHA_GROUP])", and a possible return value may be less than zero.
libnl-3.9.0/lib/route/nh.c:339: cast_underflow: An assign of a possibly negative number to an unsigned type, which might trigger an underflow.
libnl-3.9.0/lib/route/nh.c:340: overflow: The expression "len / 8UL" is deemed underflowed because at least one of its arguments has underflowed.
libnl-3.9.0/lib/route/nh.c:340: cast_overflow: An assign that casts to a different type, which might trigger an overflow.
libnl-3.9.0/lib/route/nh.c:342: overflow_sink: "size", which might have underflowed, is passed to "rtnl_nh_grp_info(size, (struct nexthop_grp const *)data, &nh_group)".
# 340| size = len / sizeof(struct nexthop_grp);
# 341|
# 342|-> err = rtnl_nh_grp_info(size, (const struct nexthop_grp *)data,
# 343| &nh_group);
# 344| if (err < 0) {
Add an internal _nla_len() with an API that clearly cannot return
negative values. Also, add _nl_assert() which in debug builds do some
consistency checks on the argument.
https://issues.redhat.com/browse/RHEL-34299
|
|
|
|
|
|
|
|
|
| |
RTA_VIA is a RTA_GATEWAY with added address family, so we should treat
them them equivalent for guessing the scope.
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
https://github.com/thom311/libnl/pull/389
|
|
|
|
| |
This is necessary to comply with current clang-format (18.1.6-3.fc40).
|