Merge pull request #502 from adamdunkels/push/fix-the-ipv6-bugfix
Fix the IPv6 bugfix
This commit is contained in:
commit
9275322b51
|
@ -53,6 +53,43 @@
|
||||||
#ifndef UIP_H_
|
#ifndef UIP_H_
|
||||||
#define UIP_H_
|
#define UIP_H_
|
||||||
|
|
||||||
|
/* Header sizes. */
|
||||||
|
#if UIP_CONF_IPV6
|
||||||
|
#define UIP_IPH_LEN 40
|
||||||
|
#define UIP_FRAGH_LEN 8
|
||||||
|
#else /* UIP_CONF_IPV6 */
|
||||||
|
#define UIP_IPH_LEN 20 /* Size of IP header */
|
||||||
|
#endif /* UIP_CONF_IPV6 */
|
||||||
|
|
||||||
|
#define UIP_UDPH_LEN 8 /* Size of UDP header */
|
||||||
|
#define UIP_TCPH_LEN 20 /* Size of TCP header */
|
||||||
|
#define UIP_ICMPH_LEN 4 /* Size of ICMP header */
|
||||||
|
|
||||||
|
#define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN) /* Size of IP +
|
||||||
|
* UDP
|
||||||
|
* header */
|
||||||
|
#define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN) /* Size of IP +
|
||||||
|
* TCP
|
||||||
|
* header */
|
||||||
|
#define UIP_TCPIP_HLEN UIP_IPTCPH_LEN
|
||||||
|
#define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN) /* size of ICMP
|
||||||
|
+ IP header */
|
||||||
|
#define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
|
||||||
|
+ IP header */
|
||||||
|
#if UIP_CONF_IPV6
|
||||||
|
/**
|
||||||
|
* The sums below are quite used in ND. When used for uip_buf, we
|
||||||
|
* include link layer length when used for uip_len, we do not, hence
|
||||||
|
* we need values with and without LLH_LEN we do not use capital
|
||||||
|
* letters as these values are variable
|
||||||
|
*/
|
||||||
|
#define uip_l2_l3_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len)
|
||||||
|
#define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
||||||
|
#define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len)
|
||||||
|
#define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
||||||
|
#endif /*UIP_CONF_IPV6*/
|
||||||
|
|
||||||
|
|
||||||
#include "net/uipopt.h"
|
#include "net/uipopt.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1881,44 +1918,6 @@ struct uip_udp_hdr {
|
||||||
#endif /* UIP_CONF_IPV6 */
|
#endif /* UIP_CONF_IPV6 */
|
||||||
|
|
||||||
|
|
||||||
/* Header sizes. */
|
|
||||||
#if UIP_CONF_IPV6
|
|
||||||
#define UIP_IPH_LEN 40
|
|
||||||
#define UIP_FRAGH_LEN 8
|
|
||||||
#else /* UIP_CONF_IPV6 */
|
|
||||||
#define UIP_IPH_LEN 20 /* Size of IP header */
|
|
||||||
#endif /* UIP_CONF_IPV6 */
|
|
||||||
|
|
||||||
#define UIP_UDPH_LEN 8 /* Size of UDP header */
|
|
||||||
#define UIP_TCPH_LEN 20 /* Size of TCP header */
|
|
||||||
#ifdef UIP_IPH_LEN
|
|
||||||
#define UIP_ICMPH_LEN 4 /* Size of ICMP header */
|
|
||||||
#endif
|
|
||||||
#define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN) /* Size of IP +
|
|
||||||
* UDP
|
|
||||||
* header */
|
|
||||||
#define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN) /* Size of IP +
|
|
||||||
* TCP
|
|
||||||
* header */
|
|
||||||
#define UIP_TCPIP_HLEN UIP_IPTCPH_LEN
|
|
||||||
#define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN) /* size of ICMP
|
|
||||||
+ IP header */
|
|
||||||
#define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
|
|
||||||
+ IP header */
|
|
||||||
#if UIP_CONF_IPV6
|
|
||||||
/**
|
|
||||||
* The sums below are quite used in ND. When used for uip_buf, we
|
|
||||||
* include link layer length when used for uip_len, we do not, hence
|
|
||||||
* we need values with and without LLH_LEN we do not use capital
|
|
||||||
* letters as these values are variable
|
|
||||||
*/
|
|
||||||
#define uip_l2_l3_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len)
|
|
||||||
#define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
|
||||||
#define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len)
|
|
||||||
#define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
|
|
||||||
#endif /*UIP_CONF_IPV6*/
|
|
||||||
|
|
||||||
|
|
||||||
#if UIP_FIXEDADDR
|
#if UIP_FIXEDADDR
|
||||||
CCIF extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
|
CCIF extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
|
||||||
#else /* UIP_FIXEDADDR */
|
#else /* UIP_FIXEDADDR */
|
||||||
|
|
|
@ -132,6 +132,101 @@
|
||||||
*/
|
*/
|
||||||
#define UIP_FIXEDETHADDR 0
|
#define UIP_FIXEDETHADDR 0
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
/*------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \defgroup uipoptgeneral General configuration options
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The link level header length.
|
||||||
|
*
|
||||||
|
* This is the offset into the uip_buf where the IP header can be
|
||||||
|
* found. For Ethernet, this should be set to 14. For SLIP, this
|
||||||
|
* should be set to 0.
|
||||||
|
*
|
||||||
|
* \note we probably won't use this constant for other link layers than
|
||||||
|
* ethernet as they have variable header length (this is due to variable
|
||||||
|
* number and type of address fields and to optional security features)
|
||||||
|
* E.g.: 802.15.4 -> 2 + (1/2*4/8) + 0/5/6/10/14
|
||||||
|
* 802.11 -> 4 + (6*3/4) + 2
|
||||||
|
* \hideinitializer
|
||||||
|
*/
|
||||||
|
#ifdef UIP_CONF_LLH_LEN
|
||||||
|
#define UIP_LLH_LEN (UIP_CONF_LLH_LEN)
|
||||||
|
#else /* UIP_LLH_LEN */
|
||||||
|
#define UIP_LLH_LEN 0
|
||||||
|
#endif /* UIP_CONF_LLH_LEN */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The size of the uIP packet buffer.
|
||||||
|
*
|
||||||
|
* The uIP packet buffer should not be smaller than 60 bytes, and does
|
||||||
|
* not need to be larger than 1514 bytes. Lower size results in lower
|
||||||
|
* TCP throughput, larger size results in higher TCP throughput.
|
||||||
|
*
|
||||||
|
* \hideinitializer
|
||||||
|
*/
|
||||||
|
#ifndef UIP_CONF_BUFFER_SIZE
|
||||||
|
#define UIP_BUFSIZE (UIP_LINK_MTU + UIP_LLH_LEN)
|
||||||
|
#else /* UIP_CONF_BUFFER_SIZE */
|
||||||
|
#define UIP_BUFSIZE (UIP_CONF_BUFFER_SIZE)
|
||||||
|
#endif /* UIP_CONF_BUFFER_SIZE */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if statistics support should be compiled in.
|
||||||
|
*
|
||||||
|
* The statistics is useful for debugging and to show the user.
|
||||||
|
*
|
||||||
|
* \hideinitializer
|
||||||
|
*/
|
||||||
|
#ifndef UIP_CONF_STATISTICS
|
||||||
|
#define UIP_STATISTICS 0
|
||||||
|
#else /* UIP_CONF_STATISTICS */
|
||||||
|
#define UIP_STATISTICS (UIP_CONF_STATISTICS)
|
||||||
|
#endif /* UIP_CONF_STATISTICS */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if logging of certain events should be compiled in.
|
||||||
|
*
|
||||||
|
* This is useful mostly for debugging. The function uip_log()
|
||||||
|
* must be implemented to suit the architecture of the project, if
|
||||||
|
* logging is turned on.
|
||||||
|
*
|
||||||
|
* \hideinitializer
|
||||||
|
*/
|
||||||
|
#ifndef UIP_CONF_LOGGING
|
||||||
|
#define UIP_LOGGING 0
|
||||||
|
#else /* UIP_CONF_LOGGING */
|
||||||
|
#define UIP_LOGGING (UIP_CONF_LOGGING)
|
||||||
|
#endif /* UIP_CONF_LOGGING */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcast support.
|
||||||
|
*
|
||||||
|
* This flag configures IP broadcast support. This is useful only
|
||||||
|
* together with UDP.
|
||||||
|
*
|
||||||
|
* \hideinitializer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef UIP_CONF_BROADCAST
|
||||||
|
#define UIP_BROADCAST 0
|
||||||
|
#else /* UIP_CONF_BROADCAST */
|
||||||
|
#define UIP_BROADCAST (UIP_CONF_BROADCAST)
|
||||||
|
#endif /* UIP_CONF_BROADCAST */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print out a uIP log message.
|
||||||
|
*
|
||||||
|
* This function must be implemented by the module that uses uIP, and
|
||||||
|
* is called by uIP whenever a log message is generated.
|
||||||
|
*/
|
||||||
|
void uip_log(char *msg);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
|
@ -382,7 +477,7 @@
|
||||||
* UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
|
* UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN.
|
||||||
*/
|
*/
|
||||||
#ifdef UIP_CONF_TCP_MSS
|
#ifdef UIP_CONF_TCP_MSS
|
||||||
#if UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
|
#if UIP_CONF_TCP_MSS > (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
|
||||||
#error UIP_CONF_TCP_MSS is too large for the current UIP_BUFSIZE
|
#error UIP_CONF_TCP_MSS is too large for the current UIP_BUFSIZE
|
||||||
#endif /* UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) */
|
#endif /* UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) */
|
||||||
#define UIP_TCP_MSS (UIP_CONF_TCP_MSS)
|
#define UIP_TCP_MSS (UIP_CONF_TCP_MSS)
|
||||||
|
@ -498,101 +593,6 @@
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \defgroup uipoptgeneral General configuration options
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The size of the uIP packet buffer.
|
|
||||||
*
|
|
||||||
* The uIP packet buffer should not be smaller than 60 bytes, and does
|
|
||||||
* not need to be larger than 1514 bytes. Lower size results in lower
|
|
||||||
* TCP throughput, larger size results in higher TCP throughput.
|
|
||||||
*
|
|
||||||
* \hideinitializer
|
|
||||||
*/
|
|
||||||
#ifndef UIP_CONF_BUFFER_SIZE
|
|
||||||
#define UIP_BUFSIZE (UIP_LINK_MTU + UIP_LLH_LEN)
|
|
||||||
#else /* UIP_CONF_BUFFER_SIZE */
|
|
||||||
#define UIP_BUFSIZE (UIP_CONF_BUFFER_SIZE)
|
|
||||||
#endif /* UIP_CONF_BUFFER_SIZE */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines if statistics support should be compiled in.
|
|
||||||
*
|
|
||||||
* The statistics is useful for debugging and to show the user.
|
|
||||||
*
|
|
||||||
* \hideinitializer
|
|
||||||
*/
|
|
||||||
#ifndef UIP_CONF_STATISTICS
|
|
||||||
#define UIP_STATISTICS 0
|
|
||||||
#else /* UIP_CONF_STATISTICS */
|
|
||||||
#define UIP_STATISTICS (UIP_CONF_STATISTICS)
|
|
||||||
#endif /* UIP_CONF_STATISTICS */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines if logging of certain events should be compiled in.
|
|
||||||
*
|
|
||||||
* This is useful mostly for debugging. The function uip_log()
|
|
||||||
* must be implemented to suit the architecture of the project, if
|
|
||||||
* logging is turned on.
|
|
||||||
*
|
|
||||||
* \hideinitializer
|
|
||||||
*/
|
|
||||||
#ifndef UIP_CONF_LOGGING
|
|
||||||
#define UIP_LOGGING 0
|
|
||||||
#else /* UIP_CONF_LOGGING */
|
|
||||||
#define UIP_LOGGING (UIP_CONF_LOGGING)
|
|
||||||
#endif /* UIP_CONF_LOGGING */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Broadcast support.
|
|
||||||
*
|
|
||||||
* This flag configures IP broadcast support. This is useful only
|
|
||||||
* together with UDP.
|
|
||||||
*
|
|
||||||
* \hideinitializer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef UIP_CONF_BROADCAST
|
|
||||||
#define UIP_BROADCAST 0
|
|
||||||
#else /* UIP_CONF_BROADCAST */
|
|
||||||
#define UIP_BROADCAST (UIP_CONF_BROADCAST)
|
|
||||||
#endif /* UIP_CONF_BROADCAST */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Print out a uIP log message.
|
|
||||||
*
|
|
||||||
* This function must be implemented by the module that uses uIP, and
|
|
||||||
* is called by uIP whenever a log message is generated.
|
|
||||||
*/
|
|
||||||
void uip_log(char *msg);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The link level header length.
|
|
||||||
*
|
|
||||||
* This is the offset into the uip_buf where the IP header can be
|
|
||||||
* found. For Ethernet, this should be set to 14. For SLIP, this
|
|
||||||
* should be set to 0.
|
|
||||||
*
|
|
||||||
* \note we probably won't use this constant for other link layers than
|
|
||||||
* ethernet as they have variable header length (this is due to variable
|
|
||||||
* number and type of address fields and to optional security features)
|
|
||||||
* E.g.: 802.15.4 -> 2 + (1/2*4/8) + 0/5/6/10/14
|
|
||||||
* 802.11 -> 4 + (6*3/4) + 2
|
|
||||||
* \hideinitializer
|
|
||||||
*/
|
|
||||||
#ifdef UIP_CONF_LLH_LEN
|
|
||||||
#define UIP_LLH_LEN (UIP_CONF_LLH_LEN)
|
|
||||||
#else /* UIP_LLH_LEN */
|
|
||||||
#define UIP_LLH_LEN 14
|
|
||||||
#endif /* UIP_CONF_LLH_LEN */
|
|
||||||
|
|
||||||
/** @} */
|
|
||||||
/*------------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* \defgroup uipoptcpu CPU architecture configuration
|
* \defgroup uipoptcpu CPU architecture configuration
|
||||||
|
|
Loading…
Reference in a new issue