app/testpmd: fix out-of-range error on bsd
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 1 Dec 2014 11:38:54 +0000 (11:38 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 1 Dec 2014 15:44:40 +0000 (16:44 +0100)
commit257dcd86c04a5a0b6d8c239a146bddf38aa628ee
tree757f407dc36a0381c294e3b6cdcd632c0a4d742b
parent91f7dd5d5e6e7dff7323206bd6cde106560f93f7
app/testpmd: fix out-of-range error on bsd

The definition value for IPPROTO_DIVERT protocol uses a value
which is out of range of the uint8_t type, giving clang compiler
errors on FreeBSD.

app/test-pmd/icmpecho.c:231:7: fatal error: overflow converting case value
        to switch condition type (258 to 2) [-Wswitch]
                case IPPROTO_DIVERT: /**< divert pseudo-protocol */

This is fixed by having the code to return the protocol name
use the uint16_t type for the protocol value input.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
app/test-pmd/icmpecho.c