diff --git a/CHANGELOG b/CHANGELOG index a1038d77..74090625 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -56,6 +56,12 @@ HISTORY ++ Bug fixes: + 2006-10-11 Christiaan Simons + * api_lib.c etharp.c, ip.c, memp.c, stats.c, sys.{c,h} tcp.h: + Partially accepted patch #5449 for ANSI C compatibility / build fixes. + * ipv4/lwip/ip.h ipv6/lwip/ip.h: Corrected UDP-Lite protocol + identifier from 170 to 136 (bug #17574). + 2006-10-10 Christiaan Simons * api_msg.c: Fixed Nagle algorithm as reported by Bob Grice. diff --git a/src/api/api_lib.c b/src/api/api_lib.c index e5da5dd4..01683b0d 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -489,7 +489,7 @@ netconn_accept(struct netconn *conn) return NULL; } - sys_mbox_fetch(conn->acceptmbox, (void **)&newconn); + sys_mbox_fetch(conn->acceptmbox, (void *)&newconn); /* Register event with callback */ if (conn->callback) (*conn->callback)(conn, NETCONN_EVT_RCVMINUS, 0); @@ -532,7 +532,7 @@ netconn_recv(struct netconn *conn) return NULL; } - sys_mbox_fetch(conn->recvmbox, (void **)&p); + sys_mbox_fetch(conn->recvmbox, (void *)&p); if (p != NULL) { @@ -577,7 +577,7 @@ netconn_recv(struct netconn *conn) sys_mbox_fetch(conn->mbox, NULL); memp_free(MEMP_API_MSG, msg); } else { - sys_mbox_fetch(conn->recvmbox, (void **)&buf); + sys_mbox_fetch(conn->recvmbox, (void *)&buf); conn->recv_avail -= buf->p->tot_len; /* Register event with callback */ if (conn->callback) diff --git a/src/core/ipv4/ip.c b/src/core/ipv4/ip.c index b4931073..ee54d9a9 100644 --- a/src/core/ipv4/ip.c +++ b/src/core/ipv4/ip.c @@ -304,7 +304,7 @@ ip_input(struct pbuf *p, struct netif *inp) { IP_STATS_INC(ip.opterr); IP_STATS_INC(ip.drop); /* unsupported protocol feature */ - snmp_inc_ipunknownprotos(); + snmp_inc_ipinunknownprotos(); return ERR_OK; #endif /* IP_REASSEMBLY */ } @@ -316,7 +316,7 @@ ip_input(struct pbuf *p, struct netif *inp) { IP_STATS_INC(ip.opterr); IP_STATS_INC(ip.drop); /* unsupported protocol feature */ - snmp_inc_ipunknownprotos(); + snmp_inc_ipinunknownprotos(); return ERR_OK; } #endif /* IP_OPTIONS == 0 */ diff --git a/src/core/memp.c b/src/core/memp.c index 94738457..ba9f796a 100644 --- a/src/core/memp.c +++ b/src/core/memp.c @@ -64,7 +64,7 @@ static const u16_t memp_sizes[MEMP_MAX] = { MEM_ALIGN_SIZE(sizeof(struct netconn)), MEM_ALIGN_SIZE(sizeof(struct api_msg)), MEM_ALIGN_SIZE(sizeof(struct tcpip_msg)), - MEM_ALIGN_SIZE(sizeof(struct sys_timeout)) + MEM_ALIGN_SIZE(sizeof(struct sys_timeo)) }; static const u16_t memp_num[MEMP_MAX] = { @@ -95,7 +95,7 @@ static u8_t memp_memory[MEM_ALIGNMENT - 1 + MEMP_TYPE_SIZE(MEMP_NUM_NETCONN, struct netconn) + MEMP_TYPE_SIZE(MEMP_NUM_API_MSG, struct api_msg) + MEMP_TYPE_SIZE(MEMP_NUM_TCPIP_MSG, struct tcpip_msg) + - MEMP_TYPE_SIZE(MEMP_NUM_SYS_TIMEOUT, struct sys_timeout)]; + MEMP_TYPE_SIZE(MEMP_NUM_SYS_TIMEOUT, struct sys_timeo)]; #if !SYS_LIGHTWEIGHT_PROT static sys_sem_t mutex; diff --git a/src/core/stats.c b/src/core/stats.c index c94623f7..50f6fe5a 100644 --- a/src/core/stats.c +++ b/src/core/stats.c @@ -84,10 +84,10 @@ void stats_display_mem(struct stats_mem *mem, char *name) { LWIP_PLATFORM_DIAG(("\n MEM %s\n\t", name)); - LWIP_PLATFORM_DIAG(("avail: %"S16_F"\n\t", mem->avail)); - LWIP_PLATFORM_DIAG(("used: %"S16_F"\n\t", mem->used)); - LWIP_PLATFORM_DIAG(("max: %"S16_F"\n\t", mem->max)); - LWIP_PLATFORM_DIAG(("err: %"S16_F"\n", mem->err)); + LWIP_PLATFORM_DIAG(("avail: %"MEM_SIZE_F"\n\t", mem->avail)); + LWIP_PLATFORM_DIAG(("used: %"MEM_SIZE_F"\n\t", mem->used)); + LWIP_PLATFORM_DIAG(("max: %"MEM_SIZE_F"\n\t", mem->max)); + LWIP_PLATFORM_DIAG(("err: %"MEM_SIZE_F"\n", mem->err)); } diff --git a/src/core/sys.c b/src/core/sys.c index a7dbf34d..b7bfbf98 100644 --- a/src/core/sys.c +++ b/src/core/sys.c @@ -50,7 +50,7 @@ sys_mbox_fetch(sys_mbox_t mbox, void **msg) { u32_t time; struct sys_timeouts *timeouts; - struct sys_timeout *tmptimeout; + struct sys_timeo *tmptimeout; sys_timeout_handler h; void *arg; @@ -102,7 +102,7 @@ sys_sem_wait(sys_sem_t sem) { u32_t time; struct sys_timeouts *timeouts; - struct sys_timeout *tmptimeout; + struct sys_timeo *tmptimeout; sys_timeout_handler h; void *arg; @@ -157,7 +157,7 @@ void sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg) { struct sys_timeouts *timeouts; - struct sys_timeout *timeout, *t; + struct sys_timeo *timeout, *t; timeout = memp_malloc(MEMP_SYS_TIMEOUT); if (timeout == NULL) { @@ -208,7 +208,7 @@ void sys_untimeout(sys_timeout_handler h, void *arg) { struct sys_timeouts *timeouts; - struct sys_timeout *prev_t, *t; + struct sys_timeo *prev_t, *t; timeouts = sys_arch_timeouts(); diff --git a/src/include/ipv4/lwip/ip.h b/src/include/ipv4/lwip/ip.h index 4c15e1a0..1c991caa 100644 --- a/src/include/ipv4/lwip/ip.h +++ b/src/include/ipv4/lwip/ip.h @@ -54,7 +54,7 @@ err_t ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, #define IP_PROTO_ICMP 1 #define IP_PROTO_UDP 17 -#define IP_PROTO_UDPLITE 170 +#define IP_PROTO_UDPLITE 136 #define IP_PROTO_TCP 6 /* This is passed as the destination address to ip_output_if (not diff --git a/src/include/ipv6/lwip/ip.h b/src/include/ipv6/lwip/ip.h index f46bf9a8..6d7d510d 100644 --- a/src/include/ipv6/lwip/ip.h +++ b/src/include/ipv6/lwip/ip.h @@ -43,7 +43,7 @@ #define IP_PROTO_ICMP 58 #define IP_PROTO_UDP 17 -#define IP_PROTO_UDPLITE 170 +#define IP_PROTO_UDPLITE 136 #define IP_PROTO_TCP 6 /* This is passed as the destination address to ip_output_if (not diff --git a/src/include/lwip/sys.h b/src/include/lwip/sys.h index 68926e95..c18c3abf 100644 --- a/src/include/lwip/sys.h +++ b/src/include/lwip/sys.h @@ -43,7 +43,7 @@ definitions of the sys_ functions. */ typedef u8_t sys_sem_t; typedef u8_t sys_mbox_t; -struct sys_timeout {u8_t dummy;}; +struct sys_timeo {u8_t dummy;}; #define sys_init() #define sys_timeout(m,h,a) @@ -68,15 +68,15 @@ struct sys_timeout {u8_t dummy;}; typedef void (* sys_timeout_handler)(void *arg); -struct sys_timeout { - struct sys_timeout *next; +struct sys_timeo { + struct sys_timeo *next; u32_t time; sys_timeout_handler h; void *arg; }; struct sys_timeouts { - struct sys_timeout *next; + struct sys_timeo *next; }; /* sys_init() must be called before anthing else. */ diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 5f968c68..6f056ce5 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -150,7 +150,7 @@ void tcp_rexmit_rto (struct tcp_pcb *pcb); #define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */ #define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */ -#define TCP_OOSEQ_TIMEOUT 6 /* x RTO */ +#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */ #define TCP_MSL 60000 /* The maximum segment lifetime in microseconds */ diff --git a/src/netif/etharp.c b/src/netif/etharp.c index 7827dd7f..526792cc 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -43,7 +43,7 @@ * This file is part of the lwIP TCP/IP stack. * */ - +#include #include "lwip/opt.h" #include "lwip/inet.h" #include "netif/etharp.h" @@ -366,7 +366,8 @@ static s8_t find_entry(struct ip_addr *ipaddr, u8_t flags) static err_t update_arp_entry(struct netif *netif, struct ip_addr *ipaddr, struct eth_addr *ethaddr, u8_t flags) { - s8_t i, k; + s8_t i; + u8_t k; LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE | 3, ("update_arp_entry()\n")); LWIP_ASSERT("netif->hwaddr_len != 0", netif->hwaddr_len != 0); LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("update_arp_entry: %"U16_F".%"U16_F".%"U16_F".%"U16_F" - %02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F":%02"X16_F"\n",