mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
Fixed includes in netif.c, removed loop_cnt_max member in struct netif (instead the define LWIP_LOOPBACK_MAX_PBUFS is used directly)
This commit is contained in:
parent
94cd14e90d
commit
3d8e5003af
@ -45,11 +45,12 @@
|
|||||||
#include "lwip/snmp.h"
|
#include "lwip/snmp.h"
|
||||||
#include "lwip/igmp.h"
|
#include "lwip/igmp.h"
|
||||||
#include "netif/etharp.h"
|
#include "netif/etharp.h"
|
||||||
#if ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING
|
#if ENABLE_LOOPBACK
|
||||||
#include "lwip/sys.h"
|
#include "lwip/sys.h"
|
||||||
#else /* ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
#if LWIP_NETIF_LOOPBACK_MULTITHREADING
|
||||||
#include "lwip/tcpip.h"
|
#include "lwip/tcpip.h"
|
||||||
#endif /* ENABLE_LOOPBACK && !LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
||||||
|
#endif /* ENABLE_LOOPBACK */
|
||||||
|
|
||||||
#if LWIP_NETIF_STATUS_CALLBACK
|
#if LWIP_NETIF_STATUS_CALLBACK
|
||||||
#define NETIF_STATUS_CALLBACK(n) { if (n->status_callback) (n->status_callback)(n); }
|
#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;
|
netif->addr_hint = NULL;
|
||||||
#endif /* LWIP_NETIF_HWADDRHINT*/
|
#endif /* LWIP_NETIF_HWADDRHINT*/
|
||||||
#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
|
#if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS
|
||||||
netif->loop_cnt_max = LWIP_LOOPBACK_MAX_PBUFS;
|
|
||||||
netif->loop_cnt_current = 0;
|
netif->loop_cnt_current = 0;
|
||||||
#endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */
|
#endif /* ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS */
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p,
|
|||||||
clen = pbuf_clen(r);
|
clen = pbuf_clen(r);
|
||||||
/* check for overflow or too many pbuf on queue */
|
/* check for overflow or too many pbuf on queue */
|
||||||
if(((netif->loop_cnt_current + clen) < netif->loop_cnt_current) ||
|
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);
|
pbuf_free(r);
|
||||||
r = NULL;
|
r = NULL;
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
|
@ -172,7 +172,6 @@ struct netif {
|
|||||||
struct pbuf *loop_first;
|
struct pbuf *loop_first;
|
||||||
struct pbuf *loop_last;
|
struct pbuf *loop_last;
|
||||||
#if LWIP_LOOPBACK_MAX_PBUFS
|
#if LWIP_LOOPBACK_MAX_PBUFS
|
||||||
u16_t loop_cnt_max;
|
|
||||||
u16_t loop_cnt_current;
|
u16_t loop_cnt_current;
|
||||||
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
|
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
|
||||||
#endif /* ENABLE_LOOPBACK */
|
#endif /* ENABLE_LOOPBACK */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user