1
0
Fork 0
mirror of git://git.netfilter.org/libmnl synced 2026-12-03 19:14:24 +00:00
No description
  • C 95.4%
  • M4 2.5%
  • Makefile 1.3%
  • Shell 0.8%
Find a file
Florian Stosse 8b018ca3d3 nlmsg: do not read past nlmsg_len in mnl_nlmsg_fprintf()
mnl_nlmsg_fprintf_payload() prints the message in 4-byte words while
i < nlmsg_len. mnl_nlmsg_ok() does not require nlmsg_len to be a multiple
of 4, so for an unaligned length the last word reads up to 3 bytes past
the end of the message, and past the buffer when it ends there.

Only print complete words in the loop, then print the 1 to 3 bytes left
over on a last row labelled "trailing bytes", so that the dump shows
them:

| 42 42 42     |	| trailing bytes |

Assisted-by: LLM
Signed-off-by: Florian Stosse <florian.stosse@harvester.fr>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2026-11-23 12:28:03 +01:00
doxygen doc: Address warnings emitted by doxygen 1.12.0 2024-09-15 17:40:32 +02:00
examples examples: rtnl: fix rtnl-link-dump* extra header 2026-05-31 16:07:31 +02:00
include include: libmnl.h: Add explicit casts to macros for C++ 2026-11-11 19:48:30 +01:00
m4 m4: resolve autoconf-2.68 warnings 2011-12-17 04:17:51 +01:00
src nlmsg: do not read past nlmsg_len in mnl_nlmsg_fprintf() 2026-11-23 12:28:03 +01:00
.gitignore doc: move doxygen config file into doxygen directory 2022-09-21 10:35:32 +02:00
autogen.sh build: abort autogen on subcommand failure 2011-08-09 14:28:49 +02:00
configure.ac build: do not build documentation automatically 2024-10-14 12:14:47 +02:00
COPYING COPYING: update file (FSF address was outdated) 2011-06-02 15:19:03 +02:00
libmnl.pc.in initial libmnl import 2010-03-19 14:55:32 +01:00
Make_global.am build: libmnl 1.0.4 release 2016-07-02 10:51:57 +02:00
Makefile.am build: doc: "make" builds & installs a full set of man pages 2021-06-23 19:05:52 +02:00
README build: do not build documentation automatically 2024-10-14 12:14:47 +02:00

= What is libmnl? =

libmnl is a minimalistic user-space library oriented to Netlink developers.
There are a lot of common tasks in parsing, validating, constructing of
both the Netlink header and TLVs that are repetitive and easy to get wrong.
This library aims to provide simple helpers that allows you to re-use code
and to avoid re-inventing the wheel. The main features of this library are:

* Small: the shared library requires around 30KB for an x86-based computer.
* Simple: this library avoids complexity and elaborated abstractions that
tend to hide Netlink details.
* Easy to use: the library simplifies the work for Netlink-wise developers.
It provides functions to make socket handling, message building, validating,
parsing and sequence tracking, easier.
* Easy to re-use: you can use the library to build your own abstraction layer
on top of this library.
* Decoupling: the interdependency of the main bricks that compose the library
is reduced, i.e. the library provides many helpers, but the programmer is not
forced to use them.

= Documentation =

If doxygen is installed on your system, you can enable it via:

       ./configure --with-doxygen=yes

then type `make`.

To access the doxygen documentation, open the doxygen/html/index.html file with
a web browser.

= Example files =

You can find several example files under examples/ that you can compile by
invoking `make check'.

= Contributing =

Please submit any patches to <netfilter-devel@vger.kernel.org>.

The contributions should broadly follow the Linux Kernel process, as detailed
in https://www.kernel.org/doc/html/latest/process/submitting-patches.html

--
08/sep/2010
Pablo Neira Ayuso <pablo@netfilter.org>