netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Parav Pandit <parav@nvidia.com>, Jon Maloy <jmaloy@redhat.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH] mnl: initialize generic netlink version
Date: Mon, 15 Apr 2024 09:33:47 -0700	[thread overview]
Message-ID: <20240415163348.39425-1-stephen@networkplumber.org> (raw)

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(+)

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;
-- 
2.43.0


             reply	other threads:[~2024-04-15 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 16:33 Stephen Hemminger [this message]
2024-04-16 15:40 ` [PATCH] mnl: initialize generic netlink version patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240415163348.39425-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=jiri@resnulli.us \
    --cc=jmaloy@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).