Print this page
dccp: getting kernel segfaults, back out recent added features
*** 15,24 ****
--- 15,25 ----
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/debug.h>
#include <sys/cmn_err.h>
+
#include <inet/dccp_impl.h>
#include <inet/dccp_stack.h>
/*
* This file contains functions to parse and process DCCP options.
*** 125,142 ****
cmn_err(CE_NOTE, "TIMESTAMP");
if (option_length != 4)
goto option_error;
/* XXX read unaligned big endian */
! option_value = ((uint8_t)value[0] << 31);
if (option_value) {
cmn_err(CE_NOTE, "Zero timestamp");
break;
}
dccp->dccp_timestamp_echo = ntohs(option_value);
! dccp->dccp_timestamp = gethrtime();
break;
case DCCP_OPTION_TIMESTAMP_ECHO:
cmn_err(CE_NOTE, "TIMESTAMP ECHO");
if (option_length != 4 &&
option_length != 6 &&
--- 126,146 ----
cmn_err(CE_NOTE, "TIMESTAMP");
if (option_length != 4)
goto option_error;
/* XXX read unaligned big endian */
! option_value = ((uint8_t)value[0] << 24);
! option_value += ((uint8_t)value[1] << 16);
! option_value += ((uint8_t)value[2] << 8);
! option_value += (uint8_t)value[3];
if (option_value) {
cmn_err(CE_NOTE, "Zero timestamp");
break;
}
dccp->dccp_timestamp_echo = ntohs(option_value);
! dccp->dccp_timestamp = TICK_TO_MSEC(LBOLT_FASTPATH);
break;
case DCCP_OPTION_TIMESTAMP_ECHO:
cmn_err(CE_NOTE, "TIMESTAMP ECHO");
if (option_length != 4 &&
option_length != 6 &&
*** 260,274 ****
}
if (dccp->dccp_timestamp_echo != 0) {
uint32_t elapsed;
int elapsed_length;
buf[len] = DCCP_OPTION_TIMESTAMP_ECHO;
len++;
- elapsed = gethrtime() - dccp->dccp_timestamp;
dccp->dccp_timestamp_echo = 0;
}
total_len = ((len + (4 - 1)) / 4) * 4;
--- 264,283 ----
}
if (dccp->dccp_timestamp_echo != 0) {
uint32_t elapsed;
int elapsed_length;
+ clock_t now;
buf[len] = DCCP_OPTION_TIMESTAMP_ECHO;
len++;
+ buf[len] = 10;
+ len++;
+
+ now = TICK_TO_MSEC(LBOLT_FASTPATH);
+ elapsed = now - dccp->dccp_timestamp;
dccp->dccp_timestamp_echo = 0;
}
total_len = ((len + (4 - 1)) / 4) * 4;