mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-02 19:29:30 +00:00
Merge pull request #457 from adamdunkels/push/uip6-bugfixes
IPv6 bugfixes
This commit is contained in:
commit
a8a9b66eff
@ -1832,8 +1832,12 @@ uip_process(uint8_t flag)
|
|||||||
UIP_TCP_BUF->seqno[2] != uip_connr->rcv_nxt[2] ||
|
UIP_TCP_BUF->seqno[2] != uip_connr->rcv_nxt[2] ||
|
||||||
UIP_TCP_BUF->seqno[3] != uip_connr->rcv_nxt[3])) {
|
UIP_TCP_BUF->seqno[3] != uip_connr->rcv_nxt[3])) {
|
||||||
|
|
||||||
if(UIP_TCP_BUF->flags & TCP_SYN) {
|
if((UIP_TCP_BUF->flags & TCP_SYN)) {
|
||||||
goto tcp_send_synack;
|
if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_RCVD) {
|
||||||
|
goto tcp_send_synack;
|
||||||
|
} else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_SYN_SENT) {
|
||||||
|
goto tcp_send_syn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
goto tcp_send_ack;
|
goto tcp_send_ack;
|
||||||
}
|
}
|
||||||
@ -2315,12 +2319,23 @@ uip_send(const void *data, int len)
|
|||||||
{
|
{
|
||||||
int copylen;
|
int copylen;
|
||||||
#define MIN(a,b) ((a) < (b)? (a): (b))
|
#define MIN(a,b) ((a) < (b)? (a): (b))
|
||||||
copylen = MIN(len, UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN -
|
|
||||||
(int)((char *)uip_sappdata - (char *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN]));
|
if(uip_sappdata != NULL) {
|
||||||
|
copylen = MIN(len, UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN -
|
||||||
|
(int)((char *)uip_sappdata -
|
||||||
|
(char *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN]));
|
||||||
|
} else {
|
||||||
|
copylen = MIN(len, UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN);
|
||||||
|
}
|
||||||
if(copylen > 0) {
|
if(copylen > 0) {
|
||||||
uip_slen = copylen;
|
uip_slen = copylen;
|
||||||
if(data != uip_sappdata) {
|
if(data != uip_sappdata) {
|
||||||
memcpy(uip_sappdata, (data), uip_slen);
|
if(uip_sappdata == NULL) {
|
||||||
|
memcpy((char *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN],
|
||||||
|
(data), uip_slen);
|
||||||
|
} else {
|
||||||
|
memcpy(uip_sappdata, (data), uip_slen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,11 @@
|
|||||||
*
|
*
|
||||||
* This should normally not be changed.
|
* This should normally not be changed.
|
||||||
*/
|
*/
|
||||||
|
#ifdef UIP_CONF_TTL
|
||||||
|
#define UIP_TTL UIP_CONF_TTL
|
||||||
|
#else /* UIP_CONF_TTL */
|
||||||
#define UIP_TTL 64
|
#define UIP_TTL 64
|
||||||
|
#endif /* UIP_CONF_TTL */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum time an IP fragment should wait in the reassembly
|
* The maximum time an IP fragment should wait in the reassembly
|
||||||
@ -378,7 +382,10 @@
|
|||||||
* 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
|
||||||
#define UIP_TCP_MSS (UIP_CONF_TCP_MSS)
|
#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
|
||||||
|
#endif /* UIP_CONF_TCP_MSS < (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) */
|
||||||
|
#define UIP_TCP_MSS (UIP_CONF_TCP_MSS)
|
||||||
#else
|
#else
|
||||||
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
|
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user