*Merged in zhoukejun/nuttx_nucleo-f767zi (pull request #838)
Add three patches about STM32 intherupts and network loopback files * Add the missing macro STM32_IRQ_NIRQS used by ./arch/arm/src/stm32f7/stm32_irq.c Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com> * The struct in_addr doesn't have the member sin_addr. Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com> * The function lib_lo_ipv6match() is for IPv6. Correct the function it calls from lib_lo_ipv4matchto() to lib_lo_ipv6match(). Also add CONFIG_NET_IPv6 for configuration. Signed-off-by: Kejun ZHOU <zhoukejun@outlook.com>
This commit is contained in:
parent
20e7ee5eb5
commit
f33ed3c8c0
@ -179,6 +179,7 @@
|
||||
#define STM32_IRQ_MDIOS (STM32_IRQ_FIRST + 109) /* 109: MDIO slave global interrupt */
|
||||
|
||||
#define STM32_IRQ_NEXTINTS 110
|
||||
#define STM32_IRQ_NIRQS (STM32_IRQ_FIRST + 110)
|
||||
|
||||
/* EXTI interrupts (Do not use IRQ numbers) */
|
||||
|
||||
|
@ -82,9 +82,9 @@ static bool lib_lo_ipv4match(FAR const void *addr, socklen_t len, int type)
|
||||
if (type == AF_INET && len >= sizeof(struct in_addr))
|
||||
{
|
||||
ipv4addr = (FAR struct in_addr *)addr;
|
||||
return net_ipv4addr_maskcmp(ipv4addr->sin_addr.s_addr,
|
||||
g_lo_ipv4addr->s_addr,
|
||||
g_lo_ipv4addr->s_addr);
|
||||
return net_ipv4addr_maskcmp(ipv4addr->s_addr,
|
||||
g_lo_ipv4addr,
|
||||
g_lo_ipv4addr);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -108,7 +108,7 @@ static bool lib_lo_ipv4match(FAR const void *addr, socklen_t len, int type)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_LOOPBACK
|
||||
#if (defined CONFIG_NET_LOOPBACK) && defined (CONFIG_NET_IPv6)
|
||||
static bool lib_lo_ipv6match(FAR const void *addr, socklen_t len, int type)
|
||||
{
|
||||
FAR struct in_addr6 *ipv6addr;
|
||||
@ -167,7 +167,8 @@ static int lib_localhost(FAR const void *addr, socklen_t len, int type,
|
||||
src = (FAR uint8_t *)&g_lo_ipv4addr;
|
||||
host->h_addrtype = AF_INET;
|
||||
}
|
||||
else if (lib_lo_ipv4match(addr, len, type))
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
else if (lib_lo_ipv6match(addr, len, type))
|
||||
{
|
||||
/* Setup to transfer the IPv6 address */
|
||||
|
||||
@ -175,6 +176,7 @@ static int lib_localhost(FAR const void *addr, socklen_t len, int type,
|
||||
src = (FAR uint8_t *)&g_lo_ipv6addr;
|
||||
host->h_addrtype = AF_INET6;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
/* Return 1 meaning that we have no errors but no match either */
|
||||
|
Loading…
Reference in New Issue
Block a user