mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-11-16 12:34:33 +00:00
[modify] #5335, PR
This commit is contained in:
@@ -360,7 +360,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex)
|
|||||||
rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter);
|
rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter);
|
||||||
counter ++;
|
counter ++;
|
||||||
|
|
||||||
tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO);
|
tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO);
|
||||||
if (tmpmutex == RT_NULL)
|
if (tmpmutex == RT_NULL)
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
else
|
else
|
||||||
@@ -779,6 +779,32 @@ void ppp_trace(int level, const char *format, ...)
|
|||||||
}
|
}
|
||||||
#endif
|
#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;
|
||||||
|
|
||||||
|
/* iterate through netifs */
|
||||||
|
for (netif = netif_list; netif != NULL; netif = netif->next)
|
||||||
|
{
|
||||||
|
/* is the netif up, does it have a link and a valid address? */
|
||||||
|
if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif)))
|
||||||
|
{
|
||||||
|
/* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */
|
||||||
|
if (src != NULL)
|
||||||
|
{
|
||||||
|
if (ip4_addr_cmp(src, netif_ip4_addr(netif)))
|
||||||
|
{
|
||||||
|
return netif;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
netif = netif_default;
|
||||||
|
return netif;
|
||||||
|
}
|
||||||
|
#endif /* LWIP_HOOK_IP4_ROUTE_SRC */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* export bsd socket symbol for RT-Thread Application Module
|
* export bsd socket symbol for RT-Thread Application Module
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -47,10 +47,6 @@
|
|||||||
|
|
||||||
#define LWIP_PLATFORM_BYTESWAP 0
|
#define LWIP_PLATFORM_BYTESWAP 0
|
||||||
|
|
||||||
#ifndef BYTE_ORDER
|
|
||||||
#define BYTE_ORDER LITTLE_ENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* #define RT_LWIP_DEBUG */
|
/* #define RT_LWIP_DEBUG */
|
||||||
|
|
||||||
#ifdef RT_LWIP_DEBUG
|
#ifdef RT_LWIP_DEBUG
|
||||||
@@ -648,4 +644,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#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__ */
|
#endif /* __LWIPOPTS_H__ */
|
||||||
|
|||||||
Reference in New Issue
Block a user