From 2fb5a71efdf750947c06f5262c1566972a8f612f Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 19 Jun 2013 22:23:05 +0200 Subject: [PATCH 1/4] patch #8030: fixed spelling of "received" --- src/core/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index a0cbb159..8690cd24 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -667,7 +667,7 @@ tcp_recved(struct tcp_pcb *pcb, u16_t len) tcp_output(pcb); } - LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: recveived %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n", + LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"U16_F" (%"U16_F").\n", len, pcb->rcv_wnd, TCP_WND - pcb->rcv_wnd)); } From 8d0664186a6ca98eb629dfe179f48b56381fb156 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 19 Jun 2013 22:26:29 +0200 Subject: [PATCH 2/4] - removed include instead of commenting it out; - CHANGELOG should contain worthy entries only, a complete log of all source code changes can be found in git (I'm not saying this has always been observed, but I'd like to keep the list of changes as short as possible for anyone to read if interested) --- CHANGELOG | 7 ------- src/include/ipv6/lwip/ip6.h | 1 - 2 files changed, 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 00ae7c86..68954d96 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -80,13 +80,6 @@ HISTORY ++ Bugfixes: - 2013-04-26: Sylvain Rochet - * dhcp.c, reverted from DOS (CRLF) to UNIX format (LF), it was saved in DOS format - by mistake the 2012-09-26 - - 2013-04-26: Sylvain Rochet - * ip6.h, cleared compilation warning, C++ style comments are not allowed in ISO C90 - 2013-04-24: patch by Liam * api_msg.c: patch #8008 Fix a potential null pointer dereference in assert diff --git a/src/include/ipv6/lwip/ip6.h b/src/include/ipv6/lwip/ip6.h index 027a20be..ac32ceec 100644 --- a/src/include/ipv6/lwip/ip6.h +++ b/src/include/ipv6/lwip/ip6.h @@ -45,7 +45,6 @@ #if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ -/* #include "lwip/ip.h" */ #include "lwip/ip6_addr.h" #include "lwip/def.h" #include "lwip/pbuf.h" From 748b70311ebdcbc9e2002a7130184031f5661786 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Sat, 29 Jun 2013 21:16:59 +0200 Subject: [PATCH 3/4] bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec --- CHANGELOG | 3 +++ src/include/ipv6/lwip/inet6.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 68954d96..1e79fa6d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -80,6 +80,9 @@ HISTORY ++ Bugfixes: + 2013-06-29: Simon Goldschmidt + * inet6.h: bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec + 2013-04-24: patch by Liam * api_msg.c: patch #8008 Fix a potential null pointer dereference in assert diff --git a/src/include/ipv6/lwip/inet6.h b/src/include/ipv6/lwip/inet6.h index dbf98df0..8359521b 100644 --- a/src/include/ipv6/lwip/inet6.h +++ b/src/include/ipv6/lwip/inet6.h @@ -58,7 +58,7 @@ struct in6_addr { u8_t u8_addr[16]; u32_t u32_addr[4]; } un; -#define s6_addr un.u32_addr +#define s6_addr un.u8_addr }; #define IN6ADDR_ANY_INIT {0,0,0,0} From ae300c98a4107458d0aa040c074d89ee9d3ac984 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Sat, 29 Jun 2013 21:47:22 +0200 Subject: [PATCH 4/4] partially fixed bug #37585: IPv6 compatibility (in socket structs) --- CHANGELOG | 3 +++ src/include/ipv4/lwip/inet.h | 7 +++++- src/include/lwip/sockets.h | 49 +++++++++++++++++++++++++----------- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e79fa6d..4e2fcf35 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -80,6 +80,9 @@ HISTORY ++ Bugfixes: + 2013-06-29: Simon Goldschmidt + * inet.h, sockets.h: partially fixed bug #37585: IPv6 compatibility (in socket structs) + 2013-06-29: Simon Goldschmidt * inet6.h: bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec diff --git a/src/include/ipv4/lwip/inet.h b/src/include/ipv4/lwip/inet.h index 7bff49b5..ec6d0909 100644 --- a/src/include/ipv4/lwip/inet.h +++ b/src/include/ipv4/lwip/inet.h @@ -40,9 +40,14 @@ extern "C" { #endif +/* If your port already typedef's in_addr_t, define IN_ADDR_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(in_addr_t) && !defined(IN_ADDR_T_DEFINED) +typedef u32_t in_addr_t; +#endif /** For compatibility with BSD code */ struct in_addr { - u32_t s_addr; + in_addr_t s_addr; }; /** 255.255.255.255 */ diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 73461374..4d6e055a 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -48,33 +48,54 @@ extern "C" { #endif +/* If your port already typedef's sa_family_t, define SA_FAMILY_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(sa_family_t) && !defined(SA_FAMILY_T_DEFINED) +typedef u8_t sa_family_t; +#endif +/* If your port already typedef's in_port_t, define IN_PORT_T_DEFINED + to prevent this code from redefining it. */ +#if !defined(in_port_t) && !defined(IN_PORT_T_DEFINED) +typedef u16_t in_port_t; +#endif + /* members are in network byte order */ struct sockaddr_in { - u8_t sin_len; - u8_t sin_family; - u16_t sin_port; - struct in_addr sin_addr; + u8_t sin_len; + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; #define SIN_ZERO_LEN 8 - char sin_zero[SIN_ZERO_LEN]; + char sin_zero[SIN_ZERO_LEN]; }; #if LWIP_IPV6 struct sockaddr_in6 { - u8_t sin6_len; /* length of this structure */ - u8_t sin6_family; /* AF_INET6 */ - u16_t sin6_port; /* Transport layer port # */ - u32_t sin6_flowinfo; /* IPv6 flow information */ - struct in6_addr sin6_addr; /* IPv6 address */ + u8_t sin6_len; /* length of this structure */ + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* Transport layer port # */ + u32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ }; #endif /* LWIP_IPV6 */ struct sockaddr { - u8_t sa_len; - u8_t sa_family; + u8_t sa_len; + sa_family_t sa_family; #if LWIP_IPV6 - u8_t sa_data[22]; + char sa_data[22]; #else /* LWIP_IPV6 */ - u8_t sa_data[14]; + char sa_data[14]; +#endif /* LWIP_IPV6 */ +}; + +struct sockaddr_storage { + u8_t s2_len; + sa_family_t ss_family; + char s2_data1[2]; + u32_t s2_data2[3]; +#if LWIP_IPV6 + u32_t s2_data3[2]; #endif /* LWIP_IPV6 */ };