From: Phil Sutter Date: Mon, 21 Aug 2017 09:27:02 +0000 (+0200) Subject: ss: Use C99 initializer in netlink_show_one() X-Git-Tag: v4.13.0~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=301826beb3baa902e2057d81912d1586459f605f;p=thirdparty%2Fiproute2.git ss: Use C99 initializer in netlink_show_one() This has the additional benefit of initializing st.ino to zero which is used later in is_sctp_assoc() function. Signed-off-by: Phil Sutter --- diff --git a/misc/ss.c b/misc/ss.c index bd68ecdca..34c6da544 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3479,17 +3479,18 @@ static int netlink_show_one(struct filter *f, int rq, int wq, unsigned long long sk, unsigned long long cb) { - struct sockstat st; + struct sockstat st = { + .state = SS_CLOSE, + .rq = rq, + .wq = wq, + .local.family = AF_NETLINK, + .remote.family = AF_NETLINK, + }; SPRINT_BUF(prot_buf) = {}; const char *prot_name; char procname[64] = {}; - st.state = SS_CLOSE; - st.rq = rq; - st.wq = wq; - st.local.family = st.remote.family = AF_NETLINK; - if (f->f) { st.rport = -1; st.lport = pid;