]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: Make sstate_namel local to scan_state()
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Dec 2016 10:40:01 +0000 (11:40 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:07:47 +0000 (14:07 -0800)
Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index a502fc5cab524483e45a1350aef92ebff51ba951..71113ca39e17aba7e9cf6611daa1781fef5398bb 100644 (file)
--- 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 ||