| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| | |
This header is entirely private to lib/route (libnl-route-3).
Move the header there, it should not be used by anybody else.
Note that libnl-route-3 exports symbols from this private header. That
is ugly, make that clearer by adding comments.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To new header "include/nl-hidden-route/nl-hidden-route.h".
libnl-route-3 exports some symbols that are no in public headers.
They are however used by other internal users in the source tree.
Such usage seems bad. We should clearly see where this is done.
Move the symbols to a separate header, where it's clear who may
use this header, and what's its purpose.
|
|/ |
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/353
|
| |
| |
| |
| |
| | |
This header is entirely private to compiling libnl-route-3 under
lib/route. Move the header there.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This header has a very specific purpose. To give access to the unit
tests to some internals.
It only is usable to parts that statically link with libnl-route-3
sources (e.g. "tests/check-direct") and libnl-route-3 itself.
The point is that the symbol there is not exported by the libnl-route-3
shared library, so a test that dynamically links against libnl-route-3
couldn't access them. Hence the internal purpose of static linking the
test with libnl-route-3 sources, and a special header for that.
Move "include/netlink-private/route/utils.h" to a separate place, to
make that usage clearer.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This header is entirely private to the source files in "lib/genl".
It's confusing to keep it separate. Place it beside the source files,
which can use it.
I guess, I just disagree with this notion, that all headers must be
under "include/" directory. Not, if the header is entirely local to one
module.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have "include/netlink-private/netlink.h", which is private
API used internally.
However, it's confusing where "include/netlink-private/netlink.h" can be
used. For example, it contains some "libnl-route-3.so" specific
extensions like "link_lookup()", hence you would think that it
can only be used with libraries that also use "libnl-route-3.so".
Well, since it's a header, you actually can also use it for example
under "lib/xfrm/", you couldn't just use those declarations because they
are implemented and accessible only under "lib/route/"
In a first step to clean this up, and move helper to separate headers,
add "include/nl-aux-{core,route}" headers with certain clear usage.
Clear in the sense who may use those headers, and what the
implementation of those headers may use.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
"base/nl-base-utils.h" (formerly "netlink-private/utils.h") contains
no libnl3 specific references, just a bunch of C helpers.
It's also a header-only "library", so it can be freely used by all our
C-code.
Move it to a separate directory, to make that clear.
|
| |
| |
| |
| |
| |
| |
| |
| | |
"utils.h" will become the internal helper "library" at the lowest
level. While "nl-auto.h" contains libnl3 specific functions, "utils.h"
does not.
Move libnl3 specific helpers from "nl-auto.h" to "utils.h".
|
|/ |
|
|
|
|
|
|
| |
- use consistent name _DIFF() for macro
- spell out the full attribute, and don't join the name via ##.
|
|\
| |
| |
| | |
https://github.com/thom311/libnl/pull/332
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
Taken from kernel v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1).
|
| |
|
|
|
|
|
|
|
|
|
| |
"netlink-private/utils.h" is our header-only, internal helper header.
We should be able to use it everywhere, not only inside the library
itself.
Unlike for exapmle <netlink-private/netlink.h>, which is only
usable from the libraries.
|
|
|
|
|
| |
We should have things with "nl" prefix in our headers. Also, netlink-private/netlink.h
is not header-only, preferably header-only stuff is in netlink-private/utils.h
|
| |
|
|
|
|
| |
Also, there is _nl_deprecated instead.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I find macros that stitch together names like "FAMILY_ATTR_##ATTR"
very confusing, because we no longer see where a certain name is used.
It breaks grepping for symbols, and it breaks cscope.
Yes, it's more verbose to not do that. If you really think that those
names are too verbose, then maybe they should get a shorter name. And
not use macros to make them palatable.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
a negative count is a bug in the caller. Still, handle it better than
just crashing. Maybe we should assert, but it doesn't seem best to
assert against user input.
Also, if count is zero, don't call memcpy(). Calling memcpy() requires
that the source and destination pointers are valid, otherwise it's
undefined behavior. I think if the caller tells us to copy zero bytes,
we should never look at the destination pointer.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace the use of the previous min()/min_t()/max()/max_t().
- min_t()/max_t() required a type, and would do plain assignment, which
C would not complain about. It is thus a cumbersome and not very safe
pattern. Avoid it.
- min()/max() did better, it used typeof() to preserve the argument types
and automatically detect it. However, it also required that both
arguments had the same integer type, which is unnecessarily strict.
_NL_MIN()/_NL_MAX() does better. It accepts arguments of any integer
types, but has a static assertions that they match in signedness.
So it's more flexible to use than min()/max() and still quite safe.
Prefer the new macros.
|
| |
| |
| |
| |
| | |
These are taken from NetworkManager code and renamed. The original code
is LGPL-2.1-or-later licensed, so we are good.
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
following API has been added to bonding
bond_alloc
bond_free
rtnl_link_bond_set_activeslave
rtnl_link_bond_set_mode
bond_put_attrs
Signed-off-by: Mallikarjun Nemagoudar <MallikarjunRamappa.Nemagoudar@infineon.com>
https://github.com/thom311/libnl/pull/349
|
|
|
|
|
| |
Previously, a NULL argument would most likely also do thing, but it also
hits undefined behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, rtnl_link_macsec_set_offload rejects any value
greater than 1 limiting the MACSEC_ATTR_OFFLOAD attribute
to the values 0 and 1 where other values are also legal.
Drop such a check since it is redundant, eventually the user
will send the netlink message to kernel, and whether the
message is valid depends on kernel.
Fixes: b6cc13d76b29 ('Supporting Hardware offload capability for MACsec')
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
http://lists.infradead.org/pipermail/libnl/2023-February/002417.html
http://lists.infradead.org/pipermail/libnl/2023-February/002420.html
http://lists.infradead.org/pipermail/libnl/2023-February/002424.html
https://github.com/thom311/libnl/pull/336
https://github.com/thom311/libnl/pull/341
|
|\ |
|
| |
| |
| |
| | |
Instead rely on the "flake8" file.
|
| |
| |
| |
| |
| | |
Add a `.flake8` file, so that running plain flake8 in the source tree
does the right thing.
|
| |
| |
| |
| | |
./python/netlink/route/links/bridge.py:29:31: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
|
| |
| |
| |
| | |
./python/netlink/core.py:194:17: E711 comparison to None should be 'if cond is None:'
|
| |
| |
| |
| | |
./python/netlink/util.py:19:1: E302 expected 2 blank lines, found 1
|
| |
| |
| |
| |
| |
| |
| | |
./python/netlink/core.py:424:9: E741 ambiguous variable name 'l'
./python/netlink/route/link.py:476:13: E741 ambiguous variable name 'l'
./python/netlink/route/tc.py:554:5: E741 ambiguous variable name 'l'
./python/netlink/route/tc.py:574:5: E741 ambiguous variable name 'l'
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
./python/examples/iface.py:66:5: F841 local variable 'e' is assigned to but never used
./python/examples/iface.py:66:5: F841 local variable 'e' is assigned to but never used
./python/examples/iface.py:109:1: F841 local variable 'e' is assigned to but never used
./python/examples/wiphy.py:116:5: F841 local variable 'e' is assigned to but never used
./python/examples/wiphy.py:116:5: F841 local variable 'e' is assigned to but never used
./python/examples/wiphy.py:158:1: F841 local variable 'e' is assigned to but never used
|
| |
| |
| |
| |
| |
| |
| | |
./doc/resolve-asciidoc-refs.py:14:22: W605 invalid escape sequence '\['
./doc/resolve-asciidoc-refs.py:14:24: W605 invalid escape sequence '\['
./doc/resolve-asciidoc-refs.py:14:30: W605 invalid escape sequence '\]'
./doc/resolve-asciidoc-refs.py:14:32: W605 invalid escape sequence '\]'
|
|/
|
|
|
|
|
|
|
| |
./doc/doxygen-link.py:4:1: F401 'fileinput' imported but unused
./doc/resolve-asciidoc-refs.py:5:1: F401 'fileinput' imported but unused
./python/doc/conf.py:14:1: F401 'sys' imported but unused
./python/doc/conf.py:14:1: F401 'os' imported but unused
./python/netlink/util.py:13:1: F401 '.core as netlink' imported but unused
./python/netlink/util.py:16:1: F401 'types' imported but unused
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This helps somewhat with the problem, that we need the correct
version of clang-format for the formatting script.
The script runs a Fedora container. It needs a working podman setup.
|