From 3d8e5003af4ea5da51ab72084c6b23117847da98 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Thu, 19 Jun 2008 16:27:18 +0000 Subject: [PATCH] Fixed includes in netif.c, removed loop_cnt_max member in struct netif (instead the define LWIP_LOOPBACK_MAX_PBUFS is used directly) --- src/core/netif.c | 10 +++++----- src/include/lwip/netif.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core/netif.c b/src/core/netif.c index 84ff165b..819dab71 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -45,11 +45,12 @@ #include "lwip/snmp.h" #include "lwip/igmp.h" #include "netif/etharp.h" -#if ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING +#if ENABLE_LOOPBACK #include "lwip/sys.h" -#else /* ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#if LWIP_NETIF_LOOPBACK_MULTITHREADING #include "lwip/tcpip.h" -#endif /* ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */ +#endif /* ENABLE_LOOPBACK */ #if LWIP_NETIF_STATUS_CALLBACK #define NETIF_STATUS_CALLBACK(n) { if (n->status_callback) (n->status_callback)(n); } @@ -124,7 +125,6 @@ netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask, netif->addr_hint = NULL; #endif /* LWIP_NETIF_HWADDRHINT*/ #if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS - netif->loop_cnt_max = LWIP_LOOPBACK_MAX_PBUFS; netif->loop_cnt_current = 0; #endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */ @@ -549,7 +549,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p, clen = pbuf_clen(r); /* check for overflow or too many pbuf on queue */ if(((netif->loop_cnt_current + clen) < netif->loop_cnt_current) || - ((netif->loop_cnt_current + clen) > netif->loop_cnt_max)) { + ((netif->loop_cnt_current + clen) > LWIP_LOOPBACK_MAX_PBUFS)) { pbuf_free(r); r = NULL; return ERR_MEM; diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 012e65a2..a3250305 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -172,7 +172,6 @@ struct netif { struct pbuf *loop_first; struct pbuf *loop_last; #if LWIP_LOOPBACK_MAX_PBUFS - u16_t loop_cnt_max; u16_t loop_cnt_current; #endif /* LWIP_LOOPBACK_MAX_PBUFS */ #endif /* ENABLE_LOOPBACK */