summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * github: add test for checking clang-format styleThomas Haller2023-07-251-0/+23
| | | | | | | | | | | | | | | | Also relevant, the actual formatting depends on the version of clang-format. Which is somewhat cumbersome. The authoritative version is the one from our github action, which currently is the one from Fedora 38.
| * clang-format: add "tools/clang-format.sh" scriptThomas Haller2023-07-251-0/+557
|/ | | | | | | | | | | | | | Historically is libnl3 not formatted with clang-format, as the project is old. However, we have a mostly usable ".clang-format" file. Also, various new files follow the automated formatting. Add a script for helping with the reformatting. Also, the script has an exclude list for files that should not be formatted. That means, new files will be required to follow the formatting. That is considered a benefit.
* python: merge branch 'th/black'Thomas Haller2023-07-2521-1395/+1562
|\
| * github: check python-black code formatting in github actionsThomas Haller2023-07-251-0/+6
| | | | | | | | | | | | | | | | Note that the formatting depends on the used black version. The authoritative black version is always the one used by the github CI check. Currently that is black==22.12.0.
| * build: add ".git-blame-ignore-revs" file for "blame.ignoreRevsFile" git configThomas Haller2023-07-251-0/+6
| | | | | | | | | | | | If you want to use git-blame and are bothered by the large diff due to the automated reformatting (python-black), consider ignoring the reformatting commit by using ".git-blame-ignore-revs" file.
| * python: reformat all Python files with python-blackThomas Haller2023-07-2518-1391/+1540
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automated code formatting is great. Use python-black for that ([1]). Black us not configurable much (uncompromising) and follows PEP8. It thus generates quite a standard, pleasing format. But the point isn't whether the formatting is always the most subjectively pleasing. The point is that the style is generated and enforceable by an automated tool. It takes away places for nit picking, while resulting in a more consistent code base. As this reformats the entire code base, it introduces a large diff and interferes with tools like git-blame. That will be somewhat alleviated by adding a "blame.ignoreRevsFile" for git in the next commit. The change is done automatically, by running python-black version black-22.8.0-2.fc38.noarch: $ black . The result is the same as $ ( git grep -l '#!.*\(PYTHON\|python\)' ; git ls-files '*.py' '*.py.in' ) \ | sort -u \ | xargs -d '\n' black Note that the exact result depends on the version of black. Currently that version is black==22.12.0 from pip. Yes, this means when we bump the version in the future, some reformatting will happen. [1] https://github.com/psf/black
| * python add "pyproject.toml" for configuring blackThomas Haller2023-07-251-0/+8
| | | | | | | | | | This allows to run `black .` and only reformat the files, that are actually black formatted.
| * github: skip Python flake8 test with clang buildThomas Haller2023-07-251-0/+1
| | | | | | | | No need to duplicate the test.
| * github: run "Build Release" test also with clangThomas Haller2023-07-251-4/+1
|/
* bridge: fix bridge info parsingStanislav Zaikin2023-07-241-0/+1
| | | | | | Fixes: 1a4031d6db73 ('lib/route: Support IFLA_BRIDGE_MODE') https://github.com/thom311/libnl/pull/339
* tests: merge branch 'gobenji:test-cache-mngr-improvements'Thomas Haller2023-07-241-13/+131
|\ | | | | | | https://github.com/thom311/libnl/pull/335
| * test-cache-mngr: Flush output after object dumpsBenjamin Poirier2023-07-241-0/+2
| | | | | | | | | | | | Flush stdout after object dumps to have complete and immediate output when stdout is not line buffered, such as when piping the test-cache-mngr output to grep.
| * test-cache-mngr: Add option to print timestampsBenjamin Poirier2023-07-241-1/+26
| | | | | | | | The format is the same as `ip -ts monitor` so the two can be compared.
| * test-cache-mngr: Add an option to iterate over all supported address familiesBenjamin Poirier2023-07-241-5/+20
| | | | | | | | | | Useful for some caches with multiple families in co_groups, such as the "route/link" cache.
| * test-cache-mngr: Add dump interval optionsBenjamin Poirier2023-07-241-7/+45
| | | | | | | | | | Some problems are related to change callbacks and those are much easier to see when they're not mixed with the cache dump.
| * test-cache-mngr: Add an option to control which oo_dump function is usedBenjamin Poirier2023-07-241-11/+49
|/ | | | Many problems are only apparent when printing at level "details".
* route/link: prevent segfault in af_request_type()Thorben Römer2023-07-241-1/+1
| | | | | | | | | Check that ops->ao_override_rtm() is set before using it, which prevents a segfault whenever af_request_type() is called with a type that has ops but that does not initialize said function in their ops struct. https://github.com/thom311/libnl/pull/333
* build: merge branch 'th/fix-github-actions'Thomas Haller2023-07-244-7/+16
|\
| * github: fix installing python dependencies via pipThomas Haller2023-07-241-3/+5
| | | | | | | | | | The test runs in a virtual environment. We cannot just install python packages via apt. Use pip as it was meant to be.
| * build: drop redundant "autogen.sh" call from "tools/build_release.sh"Thomas Haller2023-07-241-1/+0
| | | | | | | | | | The toplevel "autogen.sh" script already runs "doc/autogen.sh". No need to do it again.
| * build: change proper working directory in "doc/autogen.sh"Thomas Haller2023-07-241-0/+4
| |
| * build: ensure "autogen.sh" scripts fail on errorThomas Haller2023-07-242-3/+7
|/
* gitignore: ignore "*~" filesThomas Haller2023-07-241-0/+1
|
* docs: rtnl_link_put() 'releases' instead of 'returns'Antonio Prcela2023-07-241-1/+1
| | | | https://github.com/thom311/libnl/pull/345
* route/link: merge branch 'abuibrahim:main' with additionsThomas Haller2023-07-244-6/+57
|\ | | | | | | | | | | The patch from #342 with follow-ups. https://github.com/thom311/libnl/pull/342
| * include/linux: update copy of kernel header "linux/ipv6.h"Thomas Haller2023-07-241-3/+14
| | | | | | | | | | | | | | The point is to bump DEVCONF_MAX. Taken from upstream kernel commit 6995e2de6891c724bfeb2db33d7b87775f913ad1 (v6.4).
| * route/link: improve handling of IFLA_INET6_CONFThomas Haller2023-07-241-7/+12
| | | | | | | | | | | | | | | | | | | | On the netlink API, IFLA_INET6_CONF is a list of uint32_t integers, but the number of actually provided values depends on the kernel version (and the DEVCONF_MAX value that it was compiled with. We clone the kernel header in our source tree, so DEVCONF_MAX from the libnl3 build may differ from the running kernel. We need to keep track how many values kernel actually provides.
| * route/link: remove rtnl_link_inet6_set_conf() APIThomas Haller2023-07-243-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not clear how this API is useful. I don't think that kernel accepts netlink requests to change the settings. So constructing a libnl3 object in the user application seems not useful. Also, because of the difficulty that DEVCONF_MAX is depending on the current kernel, and changing. We need to improve how to handle the option, and a rtnl_link_inet6_set_conf() only makes that more confusing. The same is the case for rtnl_link_inet6_set_flags(), but that API already exists, while rtnl_link_inet6_set_conf() is still new and unreleased.
| * route/link: various fixes for rtnl_link_inet6_get_conf() APIThomas Haller2023-07-243-6/+6
| |
| * route/link: add accessor API for IPv6 DEVCONFAbdurrahman Hussain2023-03-293-0/+68
|/ | | | Signed-off-by: Abdurrahman Hussain <abdurrahman@hussain.rocks>
* route/bridge: merge branch ↵Thomas Haller2022-08-244-0/+350
|\ | | | | | | | | | | 'kacperlud:bridge-Add-support-for-link_info-of-a-bridge' https://github.com/thom311/libnl/pull/329
| * bridge: drop unnecessary goto in bridge_info_parse()Thomas Haller2022-08-241-5/+4
| |
| * bridge: don't normalize the u8 argument in ↵Thomas Haller2022-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rtnl_link_bridge_set_vlan_filtering() to boolean In bridge-info, we have two u8 attributes (vlan-filtering and stats-enabled). In both cases, kernel only expects there a boolean value (either zero or one). In case of vlan-filtering, I think kernel actually doesn't care, and would treat any non-zero value as true. In case of stats-enabled, kernel would reject values outside the values zero or one. Previously, libnl3 would normalize the boolean value for vlan-filtering, but not for stats-enabled. That is at least inconsistent, in particular considering that kernel requires a normalized value for stats-enabled, but not for vlan-filtering. Our public API has uint8_t parameters (and not bool). That makes sense, as it follows the netlink API. It's not clear how to handle these boolean u8 attributes best. Should the API be bool or uint8_t? Should we normalize the boolean values? In any case, do something consistently. For no particular reason, choose to not add additional logic. The user can set any value, whether that value makes sense, it's up to them.
| * bridge: expose rtnl_link_bridge_get_vlan_protocol() in host byte orderThomas Haller2022-08-241-4/+7
| | | | | | | | | | On netlink, IFLA_BR_VLAN_PROTOCOL attribute is be16. In the libnl3 API, expose the number in native endianness.
| * bridge: fix parsing vlan-protocol in bridge_info_parse()Thomas Haller2022-08-241-1/+1
| |
| * bridge: minor cleanups in "bridge_info.c"Thomas Haller2022-08-241-8/+7
| |
| * bridge: use SPDX license identifiers in bridge_info filesThomas Haller2022-08-242-14/+2
| |
| * bridge: reformat bridge_info file with clang-formatThomas Haller2022-08-242-50/+54
| |
| * bridge: extend libnl with options needed for VLAN aware forwardingRobert Dabrowski2022-08-244-1/+238
| | | | | | | | | | | | Signed-off-by: Robert Dabrowski <rdabrowski@maxlinear.com> Co-Authored-By: Kacper Ludwinski <kludwinski@maxlinear.com>
| * bridge: Add support for link_info of a bridgeLanger, Thomas2022-08-242-0/+120
|/ | | | | | | | And functions to access some new bridge attributes. Signed-off-by: Langer Thomas <tlanger@maxlinear.com> Co-Authored-By: Kacper Ludwinski <kludwinski@maxlinear.com>
* route/vlan: drop unnecessary "else" in vlan_put_attrs()Thomas Haller2022-08-241-10/+8
|
* route/vlan: fix error handling in 'lib/route/link/vlan.c'Thomas Langer2022-08-241-3/+16
| | | | | | | | related to goto label nla_put_failure Signed-off-by: Langer Thomas <tlanger@maxlinear.com> Co-Authored-By: Kacper Ludwinski <kludwinski@maxlinear.com>
* build: add comments to linker version scripts about the version tagsThomas Haller2022-08-247-0/+42
|
* all: merge branch 'yogo1212:typo'Thomas Haller2022-08-248-13/+13
|\ | | | | | | https://github.com/thom311/libnl/pull/330
| * doc: fix typoThomas Haller2022-08-241-2/+2
| |
| * doc: fix typoLeon M. George2022-08-247-11/+11
|/
* route: merge branch 'bisdn:jogo_lib_attr_handle_default_routes'Thomas Haller2022-07-073-5/+28
|\ | | | | | | https://github.com/thom311/libnl/pull/320
| * attr: reject zero length addressesJonas Gorski2022-07-071-0/+3
| | | | | | | | | | | | | | A zero length address is not a valid address in netlink, so we should not try to send them to the kernel. Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
| * route: construct all-zero addresses for default route destinationJonas Gorski2022-07-071-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A default route is equivalent to a 0.0.0.0/0 or ::/0 route, so we should construct the dst as such with a all-zero address. Since this breaks the assumption that a dst with a 0 address length is a default route, switch to checking the prefix length being 0, and make sure that there is an address part that is all-zero. This ensures we will print the actual dst in case the address is not zero, or does not exist. Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
| * addr: allow constructing all-zero addressesJonas Gorski2022-07-061-1/+1
| | | | | | | | | | | | | | | | Allow easy contruction of all-zero addresses by not passing a buf to copy. Since the object is allocated with calloc, the address data will default to all-zero, and only the length needs to be set. Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>