linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: linux-sctp@vger.kernel.org
Subject: [PATCH lksctp-tools 2/2] sctp_sendv: avoid explicit memset for var initialization
Date: Thu, 22 Apr 2021 16:36:19 -0300	[thread overview]
Message-ID: <5cb3b02a6061b6a11dba41e4feed3d80c5afd1d6.1619119690.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <cover.1619119690.git.marcelo.leitner@gmail.com>

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
 src/lib/sendmsg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/lib/sendmsg.c b/src/lib/sendmsg.c
index c2bd51029964f3bf05a512ea61d479c086f6088c..bee492134e30cbc41ecfce7117444d17c8ab9089 100644
--- a/src/lib/sendmsg.c
+++ b/src/lib/sendmsg.c
@@ -125,14 +125,12 @@ int sctp_sendv(int s, const struct iovec *iov, int iovcnt,
 {
 	char _cmsg[CMSG_SPACE(sizeof(struct sctp_sendv_spa))];
 	struct cmsghdr *cmsg = (struct cmsghdr *)_cmsg;
+	struct msghdr outmsg = {};
 	struct sockaddr *addr;
-	struct msghdr outmsg;
 	int len, cmsglen = 0;
 	int err, type, i;
 	char *addrbuf;
 
-	/* set msg_iov, msg_iovlen, msg_flags */
-	memset(&outmsg, 0x00, sizeof(outmsg));
 	outmsg.msg_iov = (struct iovec *)iov;
 	outmsg.msg_iovlen = iovcnt;
 	outmsg.msg_flags = flags;
-- 
2.30.2


  parent reply	other threads:[~2021-04-22 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 19:36 [PATCH lksctp-tools 0/2] sctp_send/v fixes Marcelo Ricardo Leitner
2021-04-22 19:36 ` [PATCH lksctp-tools 1/2] sctp_send: fix ignored flags parameter Marcelo Ricardo Leitner
2021-04-22 19:36 ` Marcelo Ricardo Leitner [this message]
2021-04-24 17:46 ` [PATCH lksctp-tools 0/2] sctp_send/v fixes Xin Long

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=5cb3b02a6061b6a11dba41e4feed3d80c5afd1d6.1619119690.git.marcelo.leitner@gmail.com \
    --to=marcelo.leitner@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    /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).