aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2016-12-02 11:40:01 +0100
committerStephen Hemminger <stephen@networkplumber.org>2016-12-02 14:07:47 -0800
commitb710a72254d8d761ad281b6c5628206183a547fb (patch)
tree038343b0d5293d933082eee0b347f0fc50a7daba /misc
parent1882c0db026e3ca33aa4c0b129f10b28100c8a3b (diff)
downloadiproute2-b710a72254d8d761ad281b6c5628206183a547fb.tar.gz
ss: Make sstate_namel local to scan_state()
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'misc')
-rw-r--r--misc/ss.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/misc/ss.c b/misc/ss.c
index a502fc5c..71113ca3 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -666,21 +666,6 @@ static const char *sctp_sstate_name[] = {
[SCTP_STATE_SHUTDOWN_ACK_SENT] = "ACK_SENT",
};
-static const char *sstate_namel[] = {
- "UNKNOWN",
- [SS_ESTABLISHED] = "established",
- [SS_SYN_SENT] = "syn-sent",
- [SS_SYN_RECV] = "syn-recv",
- [SS_FIN_WAIT1] = "fin-wait-1",
- [SS_FIN_WAIT2] = "fin-wait-2",
- [SS_TIME_WAIT] = "time-wait",
- [SS_CLOSE] = "unconnected",
- [SS_CLOSE_WAIT] = "close-wait",
- [SS_LAST_ACK] = "last-ack",
- [SS_LISTEN] = "listening",
- [SS_CLOSING] = "closing",
-};
-
struct sockstat {
struct sockstat *next;
unsigned int type;
@@ -3931,6 +3916,20 @@ static void usage(void)
static int scan_state(const char *state)
{
+ static const char * const sstate_namel[] = {
+ "UNKNOWN",
+ [SS_ESTABLISHED] = "established",
+ [SS_SYN_SENT] = "syn-sent",
+ [SS_SYN_RECV] = "syn-recv",
+ [SS_FIN_WAIT1] = "fin-wait-1",
+ [SS_FIN_WAIT2] = "fin-wait-2",
+ [SS_TIME_WAIT] = "time-wait",
+ [SS_CLOSE] = "unconnected",
+ [SS_CLOSE_WAIT] = "close-wait",
+ [SS_LAST_ACK] = "last-ack",
+ [SS_LISTEN] = "listening",
+ [SS_CLOSING] = "closing",
+ };
int i;
if (strcasecmp(state, "close") == 0 ||