lkml.org 
[lkml]   [2011]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] sctp: sctp_sendmsg: Don't initialize default_sinfo
Date
This variable only needs initialization when cmsgs.info
is NULL.

Don't use memset, just initialize every struct member.

Signed-off-by: Joe Perches <joe@perches.com>
---
net/sctp/socket.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 33d9ee6..a5d3560 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1496,8 +1496,8 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct sctp_chunk *chunk;
union sctp_addr to;
struct sockaddr *msg_name = NULL;
- struct sctp_sndrcvinfo default_sinfo = { 0 };
struct sctp_sndrcvinfo *sinfo;
+ struct sctp_sndrcvinfo default_sinfo;
struct sctp_initmsg *sinit;
sctp_assoc_t associd = 0;
sctp_cmsgs_t cmsgs = { NULL };
@@ -1761,10 +1761,13 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
* some defaults.
*/
default_sinfo.sinfo_stream = asoc->default_stream;
+ default_sinfo.sinfo_ssn = 0;
default_sinfo.sinfo_flags = asoc->default_flags;
default_sinfo.sinfo_ppid = asoc->default_ppid;
default_sinfo.sinfo_context = asoc->default_context;
default_sinfo.sinfo_timetolive = asoc->default_timetolive;
+ default_sinfo.sinfo_tsn = 0;
+ default_sinfo.sinfo_cumtsn = 0;
default_sinfo.sinfo_assoc_id = sctp_assoc2id(asoc);
sinfo = &default_sinfo;
}
--
1.7.5.rc3.dirty


\
 
 \ /
  Last update: 2011-05-12 21:21    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog