mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 18:16:13 +00:00
Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING
This commit is contained in:
parent
a5a870c683
commit
f5b783d107
@ -147,6 +147,9 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-03-06: Simon Goldschmidt
|
||||||
|
* sockets.c: Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING
|
||||||
|
|
||||||
2010-03-06: Simon Goldschmidt
|
2010-03-06: Simon Goldschmidt
|
||||||
* ipv4/ip.c: Don't try to forward link-local addresses
|
* ipv4/ip.c: Don't try to forward link-local addresses
|
||||||
|
|
||||||
|
@ -772,6 +772,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
|
|||||||
#endif /* LWIP_TCP */
|
#endif /* LWIP_TCP */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* @todo: split into multiple sendto's? */
|
||||||
LWIP_ASSERT("lwip_sendto: size must fit in u16_t", size <= 0xffff);
|
LWIP_ASSERT("lwip_sendto: size must fit in u16_t", size <= 0xffff);
|
||||||
short_size = (u16_t)size;
|
short_size = (u16_t)size;
|
||||||
LWIP_ERROR("lwip_sendto: invalid address", (((to == NULL) && (tolen == 0)) ||
|
LWIP_ERROR("lwip_sendto: invalid address", (((to == NULL) && (tolen == 0)) ||
|
||||||
@ -783,12 +784,15 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
|
|||||||
/* Should only be consider like a sample or a simple way to experiment this option (no check of "to" field...) */
|
/* Should only be consider like a sample or a simple way to experiment this option (no check of "to" field...) */
|
||||||
{ struct pbuf* p;
|
{ struct pbuf* p;
|
||||||
|
|
||||||
p = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
|
#if LWIP_NETIF_TX_SINGLE_PBUF
|
||||||
if (p == NULL) {
|
p = pbuf_alloc(PBUF_TRANSPORT, short_size, PBUF_RAM);
|
||||||
err = ERR_MEM;
|
if (p != NULL) {
|
||||||
} else {
|
MEMCPY(p->payload, data, size);
|
||||||
|
#else /* LWIP_NETIF_TX_SINGLE_PBUF */
|
||||||
|
p = pbuf_alloc(PBUF_TRANSPORT, short_size, PBUF_REF);
|
||||||
|
if (p != NULL) {
|
||||||
p->payload = (void*)data;
|
p->payload = (void*)data;
|
||||||
p->len = p->tot_len = short_size;
|
#endif /* LWIP_NETIF_TX_SINGLE_PBUF */
|
||||||
|
|
||||||
inet_addr_to_ipaddr(&remote_addr, &((const struct sockaddr_in *)to)->sin_addr);
|
inet_addr_to_ipaddr(&remote_addr, &((const struct sockaddr_in *)to)->sin_addr);
|
||||||
|
|
||||||
@ -801,6 +805,8 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
|
|||||||
UNLOCK_TCPIP_CORE();
|
UNLOCK_TCPIP_CORE();
|
||||||
|
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
|
} else {
|
||||||
|
err = ERR_MEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user