]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: Make unix_state_map local to unix_show()
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Dec 2016 10:39:59 +0000 (11:39 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Dec 2016 22:07:47 +0000 (14:07 -0800)
Also make it const, since there won't be any write access happening.

Signed-off-by: Phil Sutter <phil@nwl.cc>
misc/ss.c

index 9df4e5c26231eb4ce3dce3d61bd64f12d5152e32..1609cddde8eaaaa192499201f5378b6832306b23 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2957,9 +2957,6 @@ outerr:
        } while (0);
 }
 
-int unix_state_map[] = { SS_CLOSE, SS_SYN_SENT,
-                        SS_ESTABLISHED, SS_CLOSING };
-
 #define MAX_UNIX_REMEMBER (1024*1024/sizeof(struct sockstat))
 
 static void unix_list_drop_first(struct sockstat **list)
@@ -3101,6 +3098,8 @@ static int unix_show(struct filter *f)
        int  newformat = 0;
        int  cnt;
        struct sockstat *list = NULL;
+       const int unix_state_map[] = { SS_CLOSE, SS_SYN_SENT,
+                                      SS_ESTABLISHED, SS_CLOSING };
 
        if (!filter_af_get(f, AF_UNIX))
                return 0;