mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
ip_output: assert for p->ref == 1 to catch TCP retransmissions where the netif hasn't freed the pbuf yet
This commit is contained in:
parent
3bfc07eb92
commit
ffbb582dde
@ -538,6 +538,10 @@ err_t ip_output_if_opt(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
|
|||||||
struct ip_hdr *iphdr;
|
struct ip_hdr *iphdr;
|
||||||
static u16_t ip_id = 0;
|
static u16_t ip_id = 0;
|
||||||
|
|
||||||
|
/* pbufs passed to IP must have a ref-count of 1 as their payload pointer
|
||||||
|
gets altered as the packet is passed down the stack */
|
||||||
|
LWIP_ASSERT("p->ref == 1", p->ref == 1);
|
||||||
|
|
||||||
snmp_inc_ipoutrequests();
|
snmp_inc_ipoutrequests();
|
||||||
|
|
||||||
/* Should the IP header be generated or is it already included in p? */
|
/* Should the IP header be generated or is it already included in p? */
|
||||||
@ -651,6 +655,10 @@ ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
|
|||||||
{
|
{
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
|
|
||||||
|
/* pbufs passed to IP must have a ref-count of 1 as their payload pointer
|
||||||
|
gets altered as the packet is passed down the stack */
|
||||||
|
LWIP_ASSERT("p->ref == 1", p->ref == 1);
|
||||||
|
|
||||||
if ((netif = ip_route(dest)) == NULL) {
|
if ((netif = ip_route(dest)) == NULL) {
|
||||||
LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
|
LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
|
||||||
ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
|
ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
|
||||||
@ -687,6 +695,10 @@ ip_output_hinted(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest,
|
|||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
err_t err;
|
err_t err;
|
||||||
|
|
||||||
|
/* pbufs passed to IP must have a ref-count of 1 as their payload pointer
|
||||||
|
gets altered as the packet is passed down the stack */
|
||||||
|
LWIP_ASSERT("p->ref == 1", p->ref == 1);
|
||||||
|
|
||||||
if ((netif = ip_route(dest)) == NULL) {
|
if ((netif = ip_route(dest)) == NULL) {
|
||||||
LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
|
LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
|
||||||
ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
|
ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user