]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: Use C99 initializer in netlink_show_one()
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Aug 2017 09:27:02 +0000 (11:27 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:17:00 +0000 (17:17 -0700)
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 <phil@nwl.cc>
misc/ss.c

index bd68ecdcad7ecc97453a709ab3e45599fac27e8f..34c6da5443642f77510c7990550ba47410e84627 100644 (file)
--- 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;