some fixes to cut some extension headers before TCP processing

This commit is contained in:
Joakim Eriksson 2011-09-22 17:22:59 +02:00
parent d7c114dbd8
commit ab049ec704
6 changed files with 70 additions and 27 deletions

View file

@ -264,7 +264,7 @@ inline void
allocate_ip_from_prefix(uip_ipaddr_t *ipaddr, rpl_prefix_t *prefix)
{
memset(ipaddr, 0, sizeof(uip_ipaddr_t));
memcpy(ipaddr, &prefix->prefix, prefix->length);
memcpy(ipaddr, &prefix->prefix, (prefix->length + 7) / 8);
uip_ds6_set_addr_iid(ipaddr, &uip_lladdr);
}
@ -306,8 +306,11 @@ int
rpl_set_prefix(rpl_dag_t *dag, uip_ipaddr_t *prefix, int len)
{
if(len <= 128) {
printf("** memset\n");
memset(&dag->prefix_info.prefix, 0, 16);
printf("** memcpy\n");
memcpy(&dag->prefix_info.prefix, prefix, (len + 7) / 8);
printf("** done\n");
dag->prefix_info.length = len;
dag->prefix_info.flags = UIP_ND6_RA_FLAG_AUTONOMOUS;
PRINTF("RPL: Prefix set - will announce this in DIOs\n");

View file

@ -46,7 +46,7 @@
#include "net/rpl/rpl-private.h"
#include "net/neighbor-info.h"
#define DEBUG 1
#define DEBUG DEBUG_NONE
#include "net/uip-debug.h"
static void reset(rpl_dag_t *);

View file

@ -73,7 +73,7 @@
#endif /* RPL_CONF_OF */
/* This value decides which DAG instance we should participate in by default. */
#define RPL_DEFAULT_INSTANCE 0
#define RPL_DEFAULT_INSTANCE 0x1e
/*
* This value decides if this node must stay as a leaf or not