From 6e228d781ca808933014b2592c10d81b2780ec28 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sat, 25 Jan 2020 17:09:10 -0800 Subject: [PATCH] examples/l3fwd: make route array constant The initial route setup array is unmodified by the lpm code and can be made constant. This depends on earlier patch to fix the rte_lpm6 to use const. Signed-off-by: Stephen Hemminger --- examples/l3fwd/l3fwd_lpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index 4474efe00b..aff80feb2c 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -43,7 +43,7 @@ struct ipv6_l3fwd_lpm_route { }; /* 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735). */ -static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = { +static const struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = { {RTE_IPV4(198, 18, 0, 0), 24, 0}, {RTE_IPV4(198, 18, 1, 0), 24, 1}, {RTE_IPV4(198, 18, 2, 0), 24, 2}, @@ -55,7 +55,7 @@ static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = { }; /* 2001:0200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180) */ -static struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = { +static const struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = { {{32, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 48, 0}, {{32, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, 48, 1}, {{32, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0}, 48, 2}, -- 2.20.1