From 8bae551a6dad97f1f3b5688d917b90011cd272e1 Mon Sep 17 00:00:00 2001
From: wayneonway <121931005@qq.com>
Date: Mon, 21 Feb 2022 15:16:35 +0800
Subject: [PATCH] route: extend lws_route_uidx_t from 1 byte to 2 bytes

---
 include/libwebsockets/lws-network-helper.h | 3 ++-
 lib/core-net/route.c                       | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/libwebsockets/lws-network-helper.h b/include/libwebsockets/lws-network-helper.h
index 4ad16bef..72c9f932 100644
--- a/include/libwebsockets/lws-network-helper.h
+++ b/include/libwebsockets/lws-network-helper.h
@@ -33,7 +33,8 @@
 #include <lwip/sockets.h>
 #endif
 
-typedef uint8_t lws_route_uidx_t;
+/* cope with large amounts of route information */
+typedef uint16_t lws_route_uidx_t;
 
 typedef struct lws_dns_score {
 	uint8_t precedence;
diff --git a/lib/core-net/route.c b/lib/core-net/route.c
index 91744372..0f3746fe 100644
--- a/lib/core-net/route.c
+++ b/lib/core-net/route.c
@@ -96,7 +96,7 @@ _lws_routing_table_dump(struct lws_context *cx)
 lws_route_uidx_t
 _lws_route_get_uidx(struct lws_context *cx)
 {
-	uint8_t ou;
+	lws_route_uidx_t ou;
 
 	if (!cx->route_uidx)
 		cx->route_uidx++;
-- 
2.25.1

