Code style and debugging updates

This commit is contained in:
Adam Dunkels 2012-11-26 19:47:11 +01:00
parent 289a01b389
commit 5c5545ba7d
5 changed files with 23 additions and 17 deletions

View File

@ -1648,7 +1648,7 @@ input(void)
if((frag_size > 0) && (frag_size <= UIP_BUFSIZE)) {
sicslowpan_len = frag_size;
reass_tag = frag_tag;
timer_set(&reass_timer, SICSLOWPAN_REASS_MAXAGE*CLOCK_SECOND);
timer_set(&reass_timer, SICSLOWPAN_REASS_MAXAGE * CLOCK_SECOND / 16);
PRINTFI("sicslowpan input: INIT FRAGMENTATION (len %d, tag %d)\n",
sicslowpan_len, reass_tag);
rimeaddr_copy(&frag_sender, packetbuf_addr(PACKETBUF_ADDR_SENDER));

View File

@ -855,7 +855,7 @@ ext_hdr_options_process(void)
case UIP_EXT_HDR_OPT_RPL:
PRINTF("Processing RPL option\n");
if(rpl_verify_header(uip_ext_opt_offset)) {
PRINTF("RPL Option Error : Dropping Packet");
PRINTF("RPL Option Error: Dropping Packet\n");
return 1;
}
uip_ext_opt_offset += (UIP_EXT_HDR_OPT_RPL_BUF->opt_len) + 2;
@ -1131,9 +1131,11 @@ uip_process(uint8_t flag)
uip_ext_len += (UIP_EXT_BUF->len << 3) + 8;
break;
case 1:
PRINTF("Dropping packet after extension header processing\n");
/* silently discard */
goto drop;
case 2:
PRINTF("Sending error message after extension header processing\n");
/* send icmp error message (created in ext_hdr_options_process)
* and discard*/
goto send;
@ -1448,6 +1450,11 @@ uip_process(uint8_t flag)
#if UIP_UDP_CHECKSUMS
uip_len = uip_len - UIP_IPUDPH_LEN;
uip_appdata = &uip_buf[UIP_IPUDPH_LEN + UIP_LLH_LEN];
/* XXX hack: UDP/IPv6 receivers should drop packets with UDP
checksum 0. Here, we explicitly receive UDP packets with checksum
0. This is to be able to debug code that for one reason or
another miscomputes UDP checksums. The reception of zero UDP
checksums should be turned into a configration option. */
if(UIP_UDP_BUF->udpchksum != 0 && uip_udpchksum() != 0xffff) {
UIP_STAT(++uip_stat.udp.drop);
UIP_STAT(++uip_stat.udp.chkerr);
@ -2215,7 +2222,6 @@ uip_process(uint8_t flag)
UIP_TCP_BUF->srcport = uip_connr->lport;
UIP_TCP_BUF->destport = uip_connr->rport;
uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, &uip_connr->ripaddr);
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
PRINTF("Sending TCP packet to ");