From: Stephen Hemminger Date: Tue, 6 Mar 2018 21:07:14 +0000 (-0800) Subject: tcp_metrics; make tables const X-Git-Tag: v4.17.0~67^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a61d8968c4312dcb59850ce3545726a98f3e36c;p=thirdparty%2Fiproute2.git tcp_metrics; make tables const Signed-off-by: Stephen Hemminger Signed-off-by: David Ahern --- diff --git a/ip/tcp_metrics.c b/ip/tcp_metrics.c index 7e2d9eb34..5f394765c 100644 --- a/ip/tcp_metrics.c +++ b/ip/tcp_metrics.c @@ -47,8 +47,8 @@ static int genl_family = -1; #define CMD_DEL 0x0002 /* delete, remove */ #define CMD_FLUSH 0x0004 /* flush */ -static struct { - char *name; +static const struct { + const char *name; int code; } cmds[] = { { "list", CMD_LIST }, @@ -59,7 +59,7 @@ static struct { { "flush", CMD_FLUSH }, }; -static char *metric_name[TCP_METRIC_MAX + 1] = { +static const char *metric_name[TCP_METRIC_MAX + 1] = { [TCP_METRIC_RTT] = "rtt", [TCP_METRIC_RTTVAR] = "rttvar", [TCP_METRIC_SSTHRESH] = "ssthresh", @@ -67,8 +67,7 @@ static char *metric_name[TCP_METRIC_MAX + 1] = { [TCP_METRIC_REORDERING] = "reordering", }; -static struct -{ +static struct { int flushed; char *flushb; int flushp;