mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-10-01 06:54:51 +00:00
Adapted to changed inet.h/ip_addr.h/def.h, fixed warnings
This commit is contained in:
parent
6b1d5a6adc
commit
cceacccce6
@ -50,9 +50,12 @@
|
|||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
#include "lwip/sys.h"
|
#include "lwip/sys.h"
|
||||||
#include "lwip/timers.h"
|
#include "lwip/timers.h"
|
||||||
|
#include "lwip/inet_chksum.h"
|
||||||
|
|
||||||
|
#if PING_USE_SOCKETS
|
||||||
#include "lwip/sockets.h"
|
#include "lwip/sockets.h"
|
||||||
#include "lwip/inet.h"
|
#include "lwip/inet.h"
|
||||||
#include "lwip/inet_chksum.h"
|
#endif /* PING_USE_SOCKETS */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -255,14 +258,16 @@ ping_send(struct raw_pcb *raw, struct ip_addr *addr)
|
|||||||
LWIP_DEBUGF( PING_DEBUG, ("ping: send "));
|
LWIP_DEBUGF( PING_DEBUG, ("ping: send "));
|
||||||
ip_addr_debug_print(PING_DEBUG, addr);
|
ip_addr_debug_print(PING_DEBUG, addr);
|
||||||
LWIP_DEBUGF( PING_DEBUG, ("\n"));
|
LWIP_DEBUGF( PING_DEBUG, ("\n"));
|
||||||
|
LWIP_ASSERT("ping_size <= 0xffff", ping_size <= 0xffff);
|
||||||
|
|
||||||
if (!(p = pbuf_alloc(PBUF_IP, ping_size, PBUF_RAM))) {
|
p = pbuf_alloc(PBUF_IP, (u16_t)ping_size, PBUF_RAM);
|
||||||
|
if (!p) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((p->len == p->tot_len) && (p->next == NULL)) {
|
if ((p->len == p->tot_len) && (p->next == NULL)) {
|
||||||
iecho = p->payload;
|
iecho = p->payload;
|
||||||
|
|
||||||
ping_prepare_echo(iecho, ping_size);
|
ping_prepare_echo(iecho, (u16_t)ping_size);
|
||||||
|
|
||||||
raw_sendto(raw, p, addr);
|
raw_sendto(raw, p, addr);
|
||||||
ping_time = sys_now();
|
ping_time = sys_now();
|
||||||
@ -286,7 +291,8 @@ ping_timeout(void *arg)
|
|||||||
static void
|
static void
|
||||||
ping_raw_init(void)
|
ping_raw_init(void)
|
||||||
{
|
{
|
||||||
if (!(pcb = raw_new(IP_PROTO_ICMP))) {
|
pcb = raw_new(IP_PROTO_ICMP);
|
||||||
|
if (!pcb) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user