aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2023-04-14 12:40:56 -0700
committerStephen Hemminger <stephen@networkplumber.org>2023-04-14 12:40:56 -0700
commitf5db8310e9391b8768f9452f8e6ed34065f1af5e (patch)
treed453567a6e364a9e938741693c4158448b750785
parent8cc2eac60d5f1f5ec2c40d02c0003731c8b610dc (diff)
downloadiproute2-f5db8310e9391b8768f9452f8e6ed34065f1af5e.tar.gz
iproute_tunnel: use uint16 for tunnel encap type
The tunnel encap type is passed as unsigned 16 bit value in/out of kernel. Keep it unsigned in the encode/decode logic. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--ip/iproute_lwtunnel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 52221c697..8b7f3742b 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -32,7 +32,7 @@
#include <linux/ioam6.h>
#include <linux/ioam6_iptunnel.h>
-static const char *format_encap_type(int type)
+static const char *format_encap_type(uint16_t type)
{
switch (type) {
case LWTUNNEL_ENCAP_MPLS:
@@ -62,7 +62,7 @@ static const char *format_encap_type(int type)
static void encap_type_usage(void)
{
- int i;
+ uint16_t i;
fprintf(stderr, "Usage: ip route ... encap TYPE [ OPTIONS ] [...]\n");
@@ -73,7 +73,7 @@ static void encap_type_usage(void)
exit(-1);
}
-static int read_encap_type(const char *name)
+static uint16_t read_encap_type(const char *name)
{
if (strcmp(name, "mpls") == 0)
return LWTUNNEL_ENCAP_MPLS;
@@ -834,7 +834,7 @@ static void print_encap_xfrm(FILE *fp, struct rtattr *encap)
void lwt_print_encap(FILE *fp, struct rtattr *encap_type,
struct rtattr *encap)
{
- int et;
+ uint16_t et;
if (!encap_type)
return;