integration of new uip6 code from Mathilde and Julien - adds routing and improved interface handling
This commit is contained in:
parent
7d5e3fbfde
commit
fd3d6c44d0
15 changed files with 1558 additions and 2448 deletions
|
@ -43,7 +43,7 @@
|
|||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "net/uip-netif.h"
|
||||
#include "net/uip-ds6.h"
|
||||
#include "net/uip-icmp6.h"
|
||||
|
||||
#define DEBUG 0
|
||||
|
@ -79,11 +79,11 @@ uip_icmp6_echo_request_input(void)
|
|||
PRINTF("\n");
|
||||
|
||||
/* IP header */
|
||||
UIP_IP_BUF->ttl = uip_netif_physical_if.cur_hop_limit;
|
||||
UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit;
|
||||
|
||||
if(uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)){
|
||||
uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, &UIP_IP_BUF->srcipaddr);
|
||||
uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
|
||||
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
|
||||
} else {
|
||||
uip_ipaddr_copy(&tmp_ipaddr, &UIP_IP_BUF->srcipaddr);
|
||||
uip_ipaddr_copy(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
|
||||
|
@ -127,6 +127,13 @@ uip_icmp6_echo_request_input(void)
|
|||
void
|
||||
uip_icmp6_error_output(u8_t type, u8_t code, u32_t param) {
|
||||
uip_ext_len = 0;
|
||||
|
||||
/* check if originating packet is not an ICMP error*/
|
||||
if(UIP_IP_BUF->proto == UIP_PROTO_ICMP6 && UIP_ICMP_BUF->type < 128){
|
||||
uip_len = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* remember data of original packet before shifting */
|
||||
uip_ipaddr_copy(&tmp_ipaddr, &UIP_IP_BUF->destipaddr);
|
||||
|
||||
|
@ -142,7 +149,7 @@ uip_icmp6_error_output(u8_t type, u8_t code, u32_t param) {
|
|||
UIP_IP_BUF->tcflow = 0;
|
||||
UIP_IP_BUF->flow = 0;
|
||||
UIP_IP_BUF->proto = UIP_PROTO_ICMP6;
|
||||
UIP_IP_BUF->ttl = uip_netif_physical_if.cur_hop_limit;
|
||||
UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit;
|
||||
|
||||
/* the source should not be unspecified nor multicast, the check for
|
||||
multicast is done in uip_process */
|
||||
|
@ -155,7 +162,7 @@ uip_icmp6_error_output(u8_t type, u8_t code, u32_t param) {
|
|||
|
||||
if(uip_is_addr_mcast(&tmp_ipaddr)){
|
||||
if(type == ICMP6_PARAM_PROB && code == ICMP6_PARAMPROB_OPTION){
|
||||
uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
|
||||
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
|
||||
} else {
|
||||
uip_len = 0;
|
||||
return;
|
||||
|
@ -163,7 +170,7 @@ uip_icmp6_error_output(u8_t type, u8_t code, u32_t param) {
|
|||
} else {
|
||||
#if UIP_CONF_ROUTER
|
||||
/* need to pick a source that corresponds to this node */
|
||||
uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
|
||||
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
|
||||
#else
|
||||
uip_ipaddr_copy(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue