options.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * net/dccp/options.c
  3. *
  4. * An implementation of the DCCP protocol
  5. * Copyright (c) 2005 Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
  6. * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
  7. * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. #include <linux/dccp.h>
  15. #include <linux/module.h>
  16. #include <linux/types.h>
  17. #include <asm/unaligned.h>
  18. #include <linux/kernel.h>
  19. #include <linux/skbuff.h>
  20. #include "ackvec.h"
  21. #include "ccid.h"
  22. #include "dccp.h"
  23. #include "feat.h"
  24. int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW;
  25. int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID;
  26. int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID;
  27. int sysctl_dccp_feat_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
  28. int sysctl_dccp_feat_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT;
  29. static u32 dccp_decode_value_var(const unsigned char *bf, const u8 len)
  30. {
  31. u32 value = 0;
  32. if (len > 3)
  33. value += *bf++ << 24;
  34. if (len > 2)
  35. value += *bf++ << 16;
  36. if (len > 1)
  37. value += *bf++ << 8;
  38. if (len > 0)
  39. value += *bf;
  40. return value;
  41. }
  42. /**
  43. * dccp_parse_options - Parse DCCP options present in @skb
  44. * @sk: client|server|listening dccp socket (when @dreq != NULL)
  45. * @dreq: request socket to use during connection setup, or NULL
  46. */
  47. int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
  48. struct sk_buff *skb)
  49. {
  50. struct dccp_sock *dp = dccp_sk(sk);
  51. const struct dccp_hdr *dh = dccp_hdr(skb);
  52. const u8 pkt_type = DCCP_SKB_CB(skb)->dccpd_type;
  53. u64 ackno = DCCP_SKB_CB(skb)->dccpd_ack_seq;
  54. unsigned char *options = (unsigned char *)dh + dccp_hdr_len(skb);
  55. unsigned char *opt_ptr = options;
  56. const unsigned char *opt_end = (unsigned char *)dh +
  57. (dh->dccph_doff * 4);
  58. struct dccp_options_received *opt_recv = &dp->dccps_options_received;
  59. unsigned char opt, len;
  60. unsigned char *value;
  61. u32 elapsed_time;
  62. __be32 opt_val;
  63. int rc;
  64. int mandatory = 0;
  65. memset(opt_recv, 0, sizeof(*opt_recv));
  66. opt = len = 0;
  67. while (opt_ptr != opt_end) {
  68. opt = *opt_ptr++;
  69. len = 0;
  70. value = NULL;
  71. /* Check if this isn't a single byte option */
  72. if (opt > DCCPO_MAX_RESERVED) {
  73. if (opt_ptr == opt_end)
  74. goto out_nonsensical_length;
  75. len = *opt_ptr++;
  76. if (len < 2)
  77. goto out_nonsensical_length;
  78. /*
  79. * Remove the type and len fields, leaving
  80. * just the value size
  81. */
  82. len -= 2;
  83. value = opt_ptr;
  84. opt_ptr += len;
  85. if (opt_ptr > opt_end)
  86. goto out_nonsensical_length;
  87. }
  88. /*
  89. * CCID-Specific Options (from RFC 4340, sec. 10.3):
  90. *
  91. * Option numbers 128 through 191 are for options sent from the
  92. * HC-Sender to the HC-Receiver; option numbers 192 through 255
  93. * are for options sent from the HC-Receiver to the HC-Sender.
  94. *
  95. * CCID-specific options are ignored during connection setup, as
  96. * negotiation may still be in progress (see RFC 4340, 10.3).
  97. * The same applies to Ack Vectors, as these depend on the CCID.
  98. *
  99. */
  100. if (dreq != NULL && (opt >= 128 ||
  101. opt == DCCPO_ACK_VECTOR_0 || opt == DCCPO_ACK_VECTOR_1))
  102. goto ignore_option;
  103. switch (opt) {
  104. case DCCPO_PADDING:
  105. break;
  106. case DCCPO_MANDATORY:
  107. if (mandatory)
  108. goto out_invalid_option;
  109. if (pkt_type != DCCP_PKT_DATA)
  110. mandatory = 1;
  111. break;
  112. case DCCPO_NDP_COUNT:
  113. if (len > 6)
  114. goto out_invalid_option;
  115. opt_recv->dccpor_ndp = dccp_decode_value_var(value, len);
  116. dccp_pr_debug("%s opt: NDP count=%llu\n", dccp_role(sk),
  117. (unsigned long long)opt_recv->dccpor_ndp);
  118. break;
  119. case DCCPO_CHANGE_L:
  120. /* fall through */
  121. case DCCPO_CHANGE_R:
  122. if (pkt_type == DCCP_PKT_DATA)
  123. break;
  124. if (len < 2)
  125. goto out_invalid_option;
  126. rc = dccp_feat_change_recv(sk, opt, *value, value + 1,
  127. len - 1);
  128. /*
  129. * When there is a change error, change_recv is
  130. * responsible for dealing with it. i.e. reply with an
  131. * empty confirm.
  132. * If the change was mandatory, then we need to die.
  133. */
  134. if (rc && mandatory)
  135. goto out_invalid_option;
  136. break;
  137. case DCCPO_CONFIRM_L:
  138. /* fall through */
  139. case DCCPO_CONFIRM_R:
  140. if (pkt_type == DCCP_PKT_DATA)
  141. break;
  142. if (len < 2) /* FIXME this disallows empty confirm */
  143. goto out_invalid_option;
  144. if (dccp_feat_confirm_recv(sk, opt, *value,
  145. value + 1, len - 1))
  146. goto out_invalid_option;
  147. break;
  148. case DCCPO_ACK_VECTOR_0:
  149. case DCCPO_ACK_VECTOR_1:
  150. if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */
  151. break;
  152. if (dccp_msk(sk)->dccpms_send_ack_vector &&
  153. dccp_ackvec_parse(sk, skb, &ackno, opt, value, len))
  154. goto out_invalid_option;
  155. break;
  156. case DCCPO_TIMESTAMP:
  157. if (len != 4)
  158. goto out_invalid_option;
  159. /*
  160. * RFC 4340 13.1: "The precise time corresponding to
  161. * Timestamp Value zero is not specified". We use
  162. * zero to indicate absence of a meaningful timestamp.
  163. */
  164. opt_val = get_unaligned((__be32 *)value);
  165. if (unlikely(opt_val == 0)) {
  166. DCCP_WARN("Timestamp with zero value\n");
  167. break;
  168. }
  169. if (dreq != NULL) {
  170. dreq->dreq_timestamp_echo = ntohl(opt_val);
  171. dreq->dreq_timestamp_time = dccp_timestamp();
  172. } else {
  173. opt_recv->dccpor_timestamp =
  174. dp->dccps_timestamp_echo = ntohl(opt_val);
  175. dp->dccps_timestamp_time = dccp_timestamp();
  176. }
  177. dccp_pr_debug("%s rx opt: TIMESTAMP=%u, ackno=%llu\n",
  178. dccp_role(sk), ntohl(opt_val),
  179. (unsigned long long)
  180. DCCP_SKB_CB(skb)->dccpd_ack_seq);
  181. break;
  182. case DCCPO_TIMESTAMP_ECHO:
  183. if (len != 4 && len != 6 && len != 8)
  184. goto out_invalid_option;
  185. opt_val = get_unaligned((__be32 *)value);
  186. opt_recv->dccpor_timestamp_echo = ntohl(opt_val);
  187. dccp_pr_debug("%s rx opt: TIMESTAMP_ECHO=%u, len=%d, "
  188. "ackno=%llu", dccp_role(sk),
  189. opt_recv->dccpor_timestamp_echo,
  190. len + 2,
  191. (unsigned long long)
  192. DCCP_SKB_CB(skb)->dccpd_ack_seq);
  193. value += 4;
  194. if (len == 4) { /* no elapsed time included */
  195. dccp_pr_debug_cat("\n");
  196. break;
  197. }
  198. if (len == 6) { /* 2-byte elapsed time */
  199. __be16 opt_val2 = get_unaligned((__be16 *)value);
  200. elapsed_time = ntohs(opt_val2);
  201. } else { /* 4-byte elapsed time */
  202. opt_val = get_unaligned((__be32 *)value);
  203. elapsed_time = ntohl(opt_val);
  204. }
  205. dccp_pr_debug_cat(", ELAPSED_TIME=%u\n", elapsed_time);
  206. /* Give precedence to the biggest ELAPSED_TIME */
  207. if (elapsed_time > opt_recv->dccpor_elapsed_time)
  208. opt_recv->dccpor_elapsed_time = elapsed_time;
  209. break;
  210. case DCCPO_ELAPSED_TIME:
  211. if (dccp_packet_without_ack(skb)) /* RFC 4340, 13.2 */
  212. break;
  213. if (len == 2) {
  214. __be16 opt_val2 = get_unaligned((__be16 *)value);
  215. elapsed_time = ntohs(opt_val2);
  216. } else if (len == 4) {
  217. opt_val = get_unaligned((__be32 *)value);
  218. elapsed_time = ntohl(opt_val);
  219. } else {
  220. goto out_invalid_option;
  221. }
  222. if (elapsed_time > opt_recv->dccpor_elapsed_time)
  223. opt_recv->dccpor_elapsed_time = elapsed_time;
  224. dccp_pr_debug("%s rx opt: ELAPSED_TIME=%d\n",
  225. dccp_role(sk), elapsed_time);
  226. break;
  227. case 128 ... 191: {
  228. const u16 idx = value - options;
  229. if (ccid_hc_rx_parse_options(dp->dccps_hc_rx_ccid, sk,
  230. opt, len, idx,
  231. value) != 0)
  232. goto out_invalid_option;
  233. }
  234. break;
  235. case 192 ... 255: {
  236. const u16 idx = value - options;
  237. if (ccid_hc_tx_parse_options(dp->dccps_hc_tx_ccid, sk,
  238. opt, len, idx,
  239. value) != 0)
  240. goto out_invalid_option;
  241. }
  242. break;
  243. default:
  244. DCCP_CRIT("DCCP(%p): option %d(len=%d) not "
  245. "implemented, ignoring", sk, opt, len);
  246. break;
  247. }
  248. ignore_option:
  249. if (opt != DCCPO_MANDATORY)
  250. mandatory = 0;
  251. }
  252. /* mandatory was the last byte in option list -> reset connection */
  253. if (mandatory)
  254. goto out_invalid_option;
  255. out_nonsensical_length:
  256. /* RFC 4340, 5.8: ignore option and all remaining option space */
  257. return 0;
  258. out_invalid_option:
  259. DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT);
  260. DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR;
  261. DCCP_WARN("DCCP(%p): invalid option %d, len=%d", sk, opt, len);
  262. DCCP_SKB_CB(skb)->dccpd_reset_data[0] = opt;
  263. DCCP_SKB_CB(skb)->dccpd_reset_data[1] = len > 0 ? value[0] : 0;
  264. DCCP_SKB_CB(skb)->dccpd_reset_data[2] = len > 1 ? value[1] : 0;
  265. return -1;
  266. }
  267. EXPORT_SYMBOL_GPL(dccp_parse_options);
  268. static void dccp_encode_value_var(const u32 value, unsigned char *to,
  269. const unsigned int len)
  270. {
  271. if (len > 3)
  272. *to++ = (value & 0xFF000000) >> 24;
  273. if (len > 2)
  274. *to++ = (value & 0xFF0000) >> 16;
  275. if (len > 1)
  276. *to++ = (value & 0xFF00) >> 8;
  277. if (len > 0)
  278. *to++ = (value & 0xFF);
  279. }
  280. static inline u8 dccp_ndp_len(const u64 ndp)
  281. {
  282. if (likely(ndp <= 0xFF))
  283. return 1;
  284. return likely(ndp <= USHORT_MAX) ? 2 : (ndp <= UINT_MAX ? 4 : 6);
  285. }
  286. int dccp_insert_option(struct sock *sk, struct sk_buff *skb,
  287. const unsigned char option,
  288. const void *value, const unsigned char len)
  289. {
  290. unsigned char *to;
  291. if (DCCP_SKB_CB(skb)->dccpd_opt_len + len + 2 > DCCP_MAX_OPT_LEN)
  292. return -1;
  293. DCCP_SKB_CB(skb)->dccpd_opt_len += len + 2;
  294. to = skb_push(skb, len + 2);
  295. *to++ = option;
  296. *to++ = len + 2;
  297. memcpy(to, value, len);
  298. return 0;
  299. }
  300. EXPORT_SYMBOL_GPL(dccp_insert_option);
  301. static int dccp_insert_option_ndp(struct sock *sk, struct sk_buff *skb)
  302. {
  303. struct dccp_sock *dp = dccp_sk(sk);
  304. u64 ndp = dp->dccps_ndp_count;
  305. if (dccp_non_data_packet(skb))
  306. ++dp->dccps_ndp_count;
  307. else
  308. dp->dccps_ndp_count = 0;
  309. if (ndp > 0) {
  310. unsigned char *ptr;
  311. const int ndp_len = dccp_ndp_len(ndp);
  312. const int len = ndp_len + 2;
  313. if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN)
  314. return -1;
  315. DCCP_SKB_CB(skb)->dccpd_opt_len += len;
  316. ptr = skb_push(skb, len);
  317. *ptr++ = DCCPO_NDP_COUNT;
  318. *ptr++ = len;
  319. dccp_encode_value_var(ndp, ptr, ndp_len);
  320. }
  321. return 0;
  322. }
  323. static inline int dccp_elapsed_time_len(const u32 elapsed_time)
  324. {
  325. return elapsed_time == 0 ? 0 : elapsed_time <= 0xFFFF ? 2 : 4;
  326. }
  327. int dccp_insert_option_elapsed_time(struct sock *sk, struct sk_buff *skb,
  328. u32 elapsed_time)
  329. {
  330. const int elapsed_time_len = dccp_elapsed_time_len(elapsed_time);
  331. const int len = 2 + elapsed_time_len;
  332. unsigned char *to;
  333. if (elapsed_time_len == 0)
  334. return 0;
  335. if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN)
  336. return -1;
  337. DCCP_SKB_CB(skb)->dccpd_opt_len += len;
  338. to = skb_push(skb, len);
  339. *to++ = DCCPO_ELAPSED_TIME;
  340. *to++ = len;
  341. if (elapsed_time_len == 2) {
  342. const __be16 var16 = htons((u16)elapsed_time);
  343. memcpy(to, &var16, 2);
  344. } else {
  345. const __be32 var32 = htonl(elapsed_time);
  346. memcpy(to, &var32, 4);
  347. }
  348. return 0;
  349. }
  350. EXPORT_SYMBOL_GPL(dccp_insert_option_elapsed_time);
  351. int dccp_insert_option_timestamp(struct sock *sk, struct sk_buff *skb)
  352. {
  353. __be32 now = htonl(dccp_timestamp());
  354. /* yes this will overflow but that is the point as we want a
  355. * 10 usec 32 bit timer which mean it wraps every 11.9 hours */
  356. return dccp_insert_option(sk, skb, DCCPO_TIMESTAMP, &now, sizeof(now));
  357. }
  358. EXPORT_SYMBOL_GPL(dccp_insert_option_timestamp);
  359. static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp,
  360. struct dccp_request_sock *dreq,
  361. struct sk_buff *skb)
  362. {
  363. __be32 tstamp_echo;
  364. unsigned char *to;
  365. u32 elapsed_time, elapsed_time_len, len;
  366. if (dreq != NULL) {
  367. elapsed_time = dccp_timestamp() - dreq->dreq_timestamp_time;
  368. tstamp_echo = htonl(dreq->dreq_timestamp_echo);
  369. dreq->dreq_timestamp_echo = 0;
  370. } else {
  371. elapsed_time = dccp_timestamp() - dp->dccps_timestamp_time;
  372. tstamp_echo = htonl(dp->dccps_timestamp_echo);
  373. dp->dccps_timestamp_echo = 0;
  374. }
  375. elapsed_time_len = dccp_elapsed_time_len(elapsed_time);
  376. len = 6 + elapsed_time_len;
  377. if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN)
  378. return -1;
  379. DCCP_SKB_CB(skb)->dccpd_opt_len += len;
  380. to = skb_push(skb, len);
  381. *to++ = DCCPO_TIMESTAMP_ECHO;
  382. *to++ = len;
  383. memcpy(to, &tstamp_echo, 4);
  384. to += 4;
  385. if (elapsed_time_len == 2) {
  386. const __be16 var16 = htons((u16)elapsed_time);
  387. memcpy(to, &var16, 2);
  388. } else if (elapsed_time_len == 4) {
  389. const __be32 var32 = htonl(elapsed_time);
  390. memcpy(to, &var32, 4);
  391. }
  392. return 0;
  393. }
  394. static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat,
  395. u8 *val, u8 len)
  396. {
  397. u8 *to;
  398. if (DCCP_SKB_CB(skb)->dccpd_opt_len + len + 3 > DCCP_MAX_OPT_LEN) {
  399. DCCP_WARN("packet too small for feature %d option!\n", feat);
  400. return -1;
  401. }
  402. DCCP_SKB_CB(skb)->dccpd_opt_len += len + 3;
  403. to = skb_push(skb, len + 3);
  404. *to++ = type;
  405. *to++ = len + 3;
  406. *to++ = feat;
  407. if (len)
  408. memcpy(to, val, len);
  409. dccp_pr_debug("%s(%s (%d), ...), length %d\n",
  410. dccp_feat_typename(type),
  411. dccp_feat_name(feat), feat, len);
  412. return 0;
  413. }
  414. static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb)
  415. {
  416. struct dccp_minisock *dmsk = dccp_msk(sk);
  417. struct dccp_opt_pend *opt, *next;
  418. int change = 0;
  419. /* confirm any options [NN opts] */
  420. list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) {
  421. dccp_insert_feat_opt(skb, opt->dccpop_type,
  422. opt->dccpop_feat, opt->dccpop_val,
  423. opt->dccpop_len);
  424. /* fear empty confirms */
  425. if (opt->dccpop_val)
  426. kfree(opt->dccpop_val);
  427. kfree(opt);
  428. }
  429. INIT_LIST_HEAD(&dmsk->dccpms_conf);
  430. /* see which features we need to send */
  431. list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) {
  432. /* see if we need to send any confirm */
  433. if (opt->dccpop_sc) {
  434. dccp_insert_feat_opt(skb, opt->dccpop_type + 1,
  435. opt->dccpop_feat,
  436. opt->dccpop_sc->dccpoc_val,
  437. opt->dccpop_sc->dccpoc_len);
  438. BUG_ON(!opt->dccpop_sc->dccpoc_val);
  439. kfree(opt->dccpop_sc->dccpoc_val);
  440. kfree(opt->dccpop_sc);
  441. opt->dccpop_sc = NULL;
  442. }
  443. /* any option not confirmed, re-send it */
  444. if (!opt->dccpop_conf) {
  445. dccp_insert_feat_opt(skb, opt->dccpop_type,
  446. opt->dccpop_feat, opt->dccpop_val,
  447. opt->dccpop_len);
  448. change++;
  449. }
  450. }
  451. return 0;
  452. }
  453. /* The length of all options needs to be a multiple of 4 (5.8) */
  454. static void dccp_insert_option_padding(struct sk_buff *skb)
  455. {
  456. int padding = DCCP_SKB_CB(skb)->dccpd_opt_len % 4;
  457. if (padding != 0) {
  458. padding = 4 - padding;
  459. memset(skb_push(skb, padding), 0, padding);
  460. DCCP_SKB_CB(skb)->dccpd_opt_len += padding;
  461. }
  462. }
  463. int dccp_insert_options(struct sock *sk, struct sk_buff *skb)
  464. {
  465. struct dccp_sock *dp = dccp_sk(sk);
  466. struct dccp_minisock *dmsk = dccp_msk(sk);
  467. DCCP_SKB_CB(skb)->dccpd_opt_len = 0;
  468. if (dmsk->dccpms_send_ndp_count &&
  469. dccp_insert_option_ndp(sk, skb))
  470. return -1;
  471. if (!dccp_packet_without_ack(skb)) {
  472. if (dmsk->dccpms_send_ack_vector &&
  473. dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) &&
  474. dccp_insert_option_ackvec(sk, skb))
  475. return -1;
  476. }
  477. if (dp->dccps_hc_rx_insert_options) {
  478. if (ccid_hc_rx_insert_options(dp->dccps_hc_rx_ccid, sk, skb))
  479. return -1;
  480. dp->dccps_hc_rx_insert_options = 0;
  481. }
  482. /* Feature negotiation */
  483. /* Data packets can't do feat negotiation */
  484. if (DCCP_SKB_CB(skb)->dccpd_type != DCCP_PKT_DATA &&
  485. DCCP_SKB_CB(skb)->dccpd_type != DCCP_PKT_DATAACK &&
  486. dccp_insert_options_feat(sk, skb))
  487. return -1;
  488. /*
  489. * Obtain RTT sample from Request/Response exchange.
  490. * This is currently used in CCID 3 initialisation.
  491. */
  492. if (DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_REQUEST &&
  493. dccp_insert_option_timestamp(sk, skb))
  494. return -1;
  495. if (dp->dccps_timestamp_echo != 0 &&
  496. dccp_insert_option_timestamp_echo(dp, NULL, skb))
  497. return -1;
  498. dccp_insert_option_padding(skb);
  499. return 0;
  500. }
  501. int dccp_insert_options_rsk(struct dccp_request_sock *dreq, struct sk_buff *skb)
  502. {
  503. DCCP_SKB_CB(skb)->dccpd_opt_len = 0;
  504. if (dreq->dreq_timestamp_echo != 0 &&
  505. dccp_insert_option_timestamp_echo(NULL, dreq, skb))
  506. return -1;
  507. dccp_insert_option_padding(skb);
  508. return 0;
  509. }