|
|
36cfb7 |
From 60a5c300c8cd0fbd4c378900d298eb2444c0343d Mon Sep 17 00:00:00 2001
|
|
|
36cfb7 |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
36cfb7 |
Date: Mon, 29 Apr 2019 20:08:07 +0200
|
|
|
36cfb7 |
Subject: [PATCH] ss: Use C99 initializer in netlink_show_one()
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
|
|
|
36cfb7 |
Upstream Status: iproute2.git commit 301826beb3baa
|
|
|
36cfb7 |
|
|
|
36cfb7 |
commit 301826beb3baa902e2057d81912d1586459f605f
|
|
|
36cfb7 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
Date: Mon Aug 21 11:27:02 2017 +0200
|
|
|
36cfb7 |
|
|
|
36cfb7 |
ss: Use C99 initializer in netlink_show_one()
|
|
|
36cfb7 |
|
|
|
36cfb7 |
This has the additional benefit of initializing st.ino to zero which is
|
|
|
36cfb7 |
used later in is_sctp_assoc() function.
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
---
|
|
|
36cfb7 |
misc/ss.c | 13 +++++++------
|
|
|
36cfb7 |
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
|
36cfb7 |
|
|
|
36cfb7 |
diff --git a/misc/ss.c b/misc/ss.c
|
|
|
36cfb7 |
index cc38fc499c210..7a38e9d830e8d 100644
|
|
|
36cfb7 |
--- a/misc/ss.c
|
|
|
36cfb7 |
+++ b/misc/ss.c
|
|
|
36cfb7 |
@@ -3567,17 +3567,18 @@ static int netlink_show_one(struct filter *f,
|
|
|
36cfb7 |
int rq, int wq,
|
|
|
36cfb7 |
unsigned long long sk, unsigned long long cb)
|
|
|
36cfb7 |
{
|
|
|
36cfb7 |
- struct sockstat st;
|
|
|
36cfb7 |
+ struct sockstat st = {
|
|
|
36cfb7 |
+ .state = SS_CLOSE,
|
|
|
36cfb7 |
+ .rq = rq,
|
|
|
36cfb7 |
+ .wq = wq,
|
|
|
36cfb7 |
+ .local.family = AF_NETLINK,
|
|
|
36cfb7 |
+ .remote.family = AF_NETLINK,
|
|
|
36cfb7 |
+ };
|
|
|
36cfb7 |
|
|
|
36cfb7 |
SPRINT_BUF(prot_buf) = {};
|
|
|
36cfb7 |
const char *prot_name;
|
|
|
36cfb7 |
char procname[64] = {};
|
|
|
36cfb7 |
|
|
|
36cfb7 |
- st.state = SS_CLOSE;
|
|
|
36cfb7 |
- st.rq = rq;
|
|
|
36cfb7 |
- st.wq = wq;
|
|
|
36cfb7 |
- st.local.family = st.remote.family = AF_NETLINK;
|
|
|
36cfb7 |
-
|
|
|
36cfb7 |
if (f->f) {
|
|
|
36cfb7 |
st.rport = -1;
|
|
|
36cfb7 |
st.lport = pid;
|
|
|
36cfb7 |
--
|
|
|
36cfb7 |
2.20.1
|
|
|
36cfb7 |
|