diff mbox series

mnl: initialize generic netlink version

Message ID 20240415163348.39425-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit 0a1e1522cde95a5daea4efd2ef16bc356164c068
Delegated to: David Ahern
Headers show
Series mnl: initialize generic netlink version | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger April 15, 2024, 4:33 p.m. UTC
The version field in mnlu was being passed in but never set.
This meant that all places mnlu_gen_socket was used, the version would
be uninitialized data from malloc().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/mnl_utils.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org April 16, 2024, 3:40 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 15 Apr 2024 09:33:47 -0700 you wrote:
> The version field in mnlu was being passed in but never set.
> This meant that all places mnlu_gen_socket was used, the version would
> be uninitialized data from malloc().
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/mnl_utils.c | 2 ++
>  1 file changed, 2 insertions(+)

Here is the summary with links:
  - mnl: initialize generic netlink version
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=0a1e1522cde9

You are awesome, thank you!
diff mbox series

Patch

diff --git a/lib/mnl_utils.c b/lib/mnl_utils.c
index af5aa4f9..6c8f527e 100644
--- a/lib/mnl_utils.c
+++ b/lib/mnl_utils.c
@@ -193,6 +193,8 @@  int mnlu_gen_socket_open(struct mnlu_gen_socket *nlg, const char *family_name,
 	if (!nlg->nl)
 		goto err_socket_open;
 
+	nlg->version = version;
+
 	err = family_get(nlg, family_name);
 	if (err)
 		goto err_socket;