Browse Source

[fix] the problem of implicit declaration for "lwip_ip4_route_src".

liuxianliang 3 years ago
parent
commit
9b1f7c4ffe

+ 2 - 0
components/net/lwip-2.1.2/src/arch/sys_arch.c

@@ -779,6 +779,7 @@ void ppp_trace(int level, const char *format, ...)
 }
 #endif
 
+#ifdef LWIP_HOOK_IP4_ROUTE_SRC
 struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src)
 {
     struct netif *netif;
@@ -802,6 +803,7 @@ struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src)
     netif = netif_default;
     return netif;
 }
+#endif /* LWIP_HOOK_IP4_ROUTE_SRC */
 
 /*
  * export bsd socket symbol for RT-Thread Application Module

+ 3 - 0
components/net/lwip-2.1.2/src/lwipopts.h

@@ -645,4 +645,7 @@
 
 
 #define LWIP_HOOK_IP4_ROUTE_SRC(dest, src)  lwip_ip4_route_src(dest, src)
+#include "lwip/ip_addr.h"
+struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src);
+
 #endif /* __LWIPOPTS_H__ */