summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build: replace old "NOTE" in configure output and add summaryth/tmpThomas Haller2023-08-291-23/+10
| | | | | | | The NOTE refers to an ancient libnl3 version. It is not relevant anymore. Drop it. Instead, print some summary overview from the configuration.
* build: avoid aclocal warning about missing "m4" directoryThomas Haller2023-08-291-1/+1
| | | | | | | | | We get this warning: aclocal: warning: couldn't open directory 'm4': No such file or directory Avoid it, by letting "doc/configure.ac" use the top-level m4 directory too.
* build: run `autoupdate` for AM_PROG_LIBTOOLThomas Haller2023-08-291-2/+2
| | | | | configure.ac:67: warning: The macro `AM_PROG_LIBTOOL' is obsolete. configure.ac:67: You should run autoupdate.
* build: add "-Wno-portability" to AC_INIT_AUTOMAKE()Thomas Haller2023-08-291-1/+1
| | | | | | | | | | | | | | | | | | | Silence warnings with "-Wno-portability". Makefile.am:1130: warning: '%'-style pattern rules are a GNU make extension Makefile.am:1131: warning: dir $@: non-POSIX variable name Makefile.am:1131: (probably a GNU make extension) Makefile.am:1134: warning: '%'-style pattern rules are a GNU make extension Makefile.am:1137: warning: patsubst %,%.build-headers-test.o,$(public_headers: non-POSIX variable name Makefile.am:1137: (probably a GNU make extension) We care about portability, but only to the extend that we test configurations via CI. As all our current CI passes, the warning is bogus and not something we will fix. If you come up in a situation where this is a problem, then we have a real scenario at hand and something to fix. Unless that happens, we target a real implementation and not the make specification.
* license: merge branch 'th/fix-gpl-license'Thomas Haller2023-08-214-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the license for a few files from GPL-2.0-only to LGPL-2.1-only. All relevant contributions seems to have been made by Thomas Graf. I presume, this was just a mistake in the license header, as the project as a whole is LGPL licensed. Thomas as working for Red Hat at the time, maybe the copyright for the code is with Red Hat. In any case, the wrong licensing needs to be fixed. If there are any objections to this, the offending code needs to be removed. Please reach out in that case. https://github.com/thom311/libnl/pull/357
| * license: fix/adjust license for "src/nl-cls-add.c"Thomas Haller2023-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit ef858fb492df ('- Reworked the classifier interface. - Added initial ematch support - Added support for the basic classifier - Added support for the cgroup classifier'), the license headers were added as GPL-2.0-only. That is in conflict with the licences of the project and a problem. We would either have to delete the code, or "change" the license. The file only had (relevant) contributions by Thomas Graf. There are some trivial modifications by myself (Thomas Haller), and I agree with this change. There is also a small change by another contributor, which does seem trivial enough to not prevent changing the license: - 4ff512b05456 [Cong Wang] ('correct --protocol option for nl-cls-* utilities') - c52087601198 [Peter Wu] ('trivial: whitespace-only fixes for src and lib') - cee0b1b50c2e [Yegor Yefremov] ('Add SPDX identifiers') See `gitk src/nl-cls-add.c`.
| * license: fix/adjust license for "src/nl-addr-{add,delete,list}.c"Thomas Haller2023-08-213-3/+3
|/ | | | | | | | | | | | | | | | | | | In commit 5e732ad075e5 ('New set of address management tools'), the license headers were added/changed as GPL-2.0-only. That is in conflict with the licences of the project and a problem. We would either have to delete the code, or "change" the license. The files only had (relevant) contributions by Thomas Graf. There are some trivial modifications by myself (Thomas Haller), and I agree with this change. There are also small changes by another contributors, which seem trivial enough to not prevent changing the license: - 7701c8572fa4 [Pavel Roskin] ('Make some functions and global variables static') - c52087601198 [Peter Wu] ('trivial: whitespace-only fixes for src and lib') - cee0b1b50c2e [Yegor Yefremov] ('Add SPDX identifiers') See `gitk src/nl-addr-{add,delete,list}.c`.
* all: merge 'th/avoid-mt-unsafe-libc'Thomas Haller2023-08-189-23/+89
|\
| * tests: use thread-safe localtime_r() instead of localtime()Thomas Haller2023-08-181-1/+2
| |
| * lib/xfrm: use thread-safe gmtime_r() instead of gmtime()Thomas Haller2023-08-183-6/+9
| |
| * tests: avoid srandom()/random() in favor of _nltst_rand_u32()Thomas Haller2023-08-181-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | srandom() and random() are a code smell, because they are not thread safe. Avoid its usage, even if this was only for testing. Even in testing code, we don't want to find those functions and have to reason why they are fine for testing. Just don't. Arguably, _nltst_rand_u32() calls jrand48(), which (in glibc) is possibly not thread-safe either. But that is only one place for investigation, instead of 3. Also, _nltst_rand_u32() honors NLTST_SEED_RAND to generate a reproducible sequence of random numbers.
| * lib: use getprotobyname_r(), getprotobynumber_r() if availableThomas Haller2023-08-183-8/+67
| | | | | | | | Avoid non-threadsafe libc API.
| * lib: fix error handling in nl_str2ip_proto()Thomas Haller2023-08-182-3/+3
| |
| * tests: check nl_str2ip_proto()Thomas Haller2023-08-181-0/+9
|/
* route: fix documentation comment for nl_nh_group_infoThomas Haller2023-08-171-2/+2
| | | | | | https://github.com/thom311/libnl/issues/356 Fixes: 780d06ae8bee ('route: add nh type')
* clang-format: add "-l" alias for option in "tools/clang-format.sh"Thomas Haller2023-08-171-11/+11
|
* clang-format: merge branch 'th/update-clang-format'Thomas Haller2023-08-1710-276/+279
|\
| * clang-format: ignore reformatting commit in ".git-blame-ignore-revs"Thomas Haller2023-08-171-0/+1
| |
| * clang-format: reformat files with new formatThomas Haller2023-08-178-255/+255
| | | | | | | | $ ./tools/clang-format.sh
| * clang-format: update ".clang-format" from linux kernelThomas Haller2023-08-171-21/+23
|/ | | | | | | Taken from linux kernel v6.4 at [1]. The file is unmodified, except for the "ForEachMacros". [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/.clang-format?id=6995e2de6891c724bfeb2db33d7b87775f913ad1
* include: use <linux/$file> instead of <linux-private/linux/$file>Thomas Haller2023-08-08122-147/+147
| | | | | | As we now copy all linux headers, and we have include/linux-private in our include search path, just include the linux headers as we commonly do.
* include/linux: add all linux headers that we useThomas Haller2023-08-0826-0/+4291
| | | | | | | | | | | | | | | | | | | | | | | It doesn't work well, to only include some parts of the linux headers. For example, <linux/ipv6.h> includes <linux/stddef.h>, which previously wasn't copied. Worse, <linux/ipv6.h> depends on some recent defines in <linux/stddef.h>, so we cannot just mix kernel headers from different versions. Import all the used <linux/*> kernel headers. Note that architecture specific headers from "<asm/*" and "<asm-generic/*" are not copied. Taken from v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1). Reimport via cd /data/src/linux make headers_install ARCH=i386 INSTALL_HDR_PATH=/tmp/Linux/ cd /data/src/libnl3 for h in $(cd include/linux-private/; git ls-files .); do \ /bin/cp /tmp/Linux/include/$h include/linux-private/$h ; \ done
* include/linux: update all linux headersThomas Haller2023-08-0834-159/+1977
| | | | Taken from v6.4 (6995e2de6891c724bfeb2db33d7b87775f913ad1).
* include: add missing "extern "C"" specifier to public headersThomas Haller2023-08-076-0/+49
|
* all: drop "extern "C"" from internal codeThomas Haller2023-08-075-40/+0
| | | | | libnl3 itself needs to be build with a C compiler. Drop the unnecessary "extern "C"" parts from internal code.
* build: add "check-local-build-headers" test target to build public headersThomas Haller2023-08-071-0/+35
|
* build: add a "check-local" build targetThomas Haller2023-08-071-0/+3
| | | | This is currently unused.
* include: fix headers "include/netlink/route/{netconf.h,route/qdisc/red.h}" ↵Thomas Haller2023-08-072-0/+3
| | | | to be self-contained
* idiag: "fix" license for "idiag-socket-details" toolThomas Haller2023-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | This tool had a GPL-2.0-only license text when it was added. That is not what we require for libnl3 contributions. Since being added, the file was only touched by me (Thomas Haller) and Yegor Yefremov. Those are all trivial contributions. This leaves Joe Damato, who initially contributed the file. Joe agrees with this adjustment of the license (Thanks!!). Note that there is also a line: Copyright (c) 2013 Sassano Systems LLC <joe@sassanosystems.com> Apparently, the copyright for the contribution is also with Joe, so there is no further problem. Fixes: c97c8c2bfdb0 ('Add idiag-socket-details') https://github.com/thom311/libnl/pull/354
* github: test build on alpine:latest for muslThomas Haller2023-08-031-2/+62
|
* Revert "gitignore: ignore patch files"Thomas Haller2023-08-031-1/+0
| | | | | | I don't think we want to ignore patch files. Why should we? This reverts commit f55ef93d1eb9d792af2a3b79c055ee21bf14e9ea.
* github: add test for linking with mold and fail on unknown versionsThomas Haller2023-08-031-0/+13
|
* route/nh: drop not implemented "nh" API from headersThomas Haller2023-08-032-8/+0
| | | | Fixes: 780d06ae8bee ('route: add nh type')
* build: fix exporting symbol rtnl_link_info_ops_getThomas Haller2023-08-032-2/+1
| | | | | | | | | So "rtnl_link_info_ops_get" didn't actually work with libnl-3.7. Fix for 3.8. https://github.com/thom311/libnl/issues/350 Fixes: 2e0d7f85d2ae ('lib: add rtnl_link_info_ops_get() and take lock for rtnl_link_info_ops's io_refcnt')
* merge branch 'th/cleanup-includes-1'Thomas Haller2023-08-03128-203/+177
|\
| * include: don't explicitly include headers from "nl-default.h"Thomas Haller2023-08-0316-32/+0
| |
| * tests: cleanup include of netlink headersThomas Haller2023-08-031-3/+2
| | | | | | | | | | For no strong reason, we include the public netlink headers with <> instead of "". Be consistent.
| * build: cleanup default include list in Makefile.amThomas Haller2023-08-031-12/+13
| |
| * include: include private linux headers with explicit pathThomas Haller2023-08-03120-151/+153
| | | | | | | | | | | | | | We have copies of the linux headers in include/linux-private. For those files, include the copies explicitly. No practice there is no difference, since we build with :-Ilinux-private".
| * python: add make target for python buildThomas Haller2023-08-031-0/+4
| |
| * python: drop unused "python/netlink/fixes.h"Thomas Haller2023-08-032-2/+0
| |
| * gitignore: ignore python build artifactsThomas Haller2023-08-031-3/+2
| |
| * gitignore: ignore generated doc filesThomas Haller2023-08-031-0/+3
|/
* include: merge branch 'th/move-private-headers-3'Thomas Haller2023-08-02271-2155/+2758
|\
| * include: drop "netlink-private/netlink.h" and move declarationsThomas Haller2023-08-02152-517/+347
| |
| * all: cleanup includes and use "nm-default.h"Thomas Haller2023-08-02235-350/+985
| |
| * include: add "nl-default.h" headerThomas Haller2023-08-025-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | In an autotools project, <config.h> should be included as very first thing in almost all cases. We also want include other stuff, in particular "include/base", which contains our own extensions on top of plain C (it is thus applicable to all our C modules). Add a "nl-default.h", which can be included as first and prepares a base for each C source. Additionally, since header files are never compiled directly (only indirectly by being included), they can rely that "nl-default.h" is always available.
| * build: move "lib/defs.h" to "include/config.h"Thomas Haller2023-08-025-5/+8
| | | | | | | | | | | | | | It seems "config.h" is the more common name for the autotools generated header. In any case, it should not be under "lib", because lib is specifically about libnl-3 and similar libraries. It's awkward for modules under src to include from lib.
| * include: split and drop "netlink-private/types.h"Thomas Haller2023-08-02121-1512/+1634
| | | | | | | | | | Move all the declarations from "netlink-private/types.h" to places closer to where they are used.
| * include: rename "nl-shared-core" to "nl-priv-dynamic-core"Thomas Haller2023-08-027-8/+8
| | | | | | | | | | Naming is just so important to understand what this is. This name is better.