feat.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /*
  2. * net/dccp/feat.c
  3. *
  4. * An implementation of the DCCP protocol
  5. * Andrea Bittau <a.bittau@cs.ucl.ac.uk>
  6. *
  7. * ASSUMPTIONS
  8. * -----------
  9. * o All currently known SP features have 1-byte quantities. If in the future
  10. * extensions of RFCs 4340..42 define features with item lengths larger than
  11. * one byte, a feature-specific extension of the code will be required.
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * as published by the Free Software Foundation; either version
  16. * 2 of the License, or (at your option) any later version.
  17. */
  18. #include <linux/module.h>
  19. #include "ccid.h"
  20. #include "feat.h"
  21. #define DCCP_FEAT_SP_NOAGREE (-123)
  22. int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature,
  23. u8 *val, u8 len, gfp_t gfp)
  24. {
  25. struct dccp_opt_pend *opt;
  26. dccp_feat_debug(type, feature, *val);
  27. if (len > 3) {
  28. DCCP_WARN("invalid length %d\n", len);
  29. return -EINVAL;
  30. }
  31. /* XXX add further sanity checks */
  32. /* check if that feature is already being negotiated */
  33. list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) {
  34. /* ok we found a negotiation for this option already */
  35. if (opt->dccpop_feat == feature && opt->dccpop_type == type) {
  36. dccp_pr_debug("Replacing old\n");
  37. /* replace */
  38. BUG_ON(opt->dccpop_val == NULL);
  39. kfree(opt->dccpop_val);
  40. opt->dccpop_val = val;
  41. opt->dccpop_len = len;
  42. opt->dccpop_conf = 0;
  43. return 0;
  44. }
  45. }
  46. /* negotiation for a new feature */
  47. opt = kmalloc(sizeof(*opt), gfp);
  48. if (opt == NULL)
  49. return -ENOMEM;
  50. opt->dccpop_type = type;
  51. opt->dccpop_feat = feature;
  52. opt->dccpop_len = len;
  53. opt->dccpop_val = val;
  54. opt->dccpop_conf = 0;
  55. opt->dccpop_sc = NULL;
  56. BUG_ON(opt->dccpop_val == NULL);
  57. list_add_tail(&opt->dccpop_node, &dmsk->dccpms_pending);
  58. return 0;
  59. }
  60. EXPORT_SYMBOL_GPL(dccp_feat_change);
  61. static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr)
  62. {
  63. struct dccp_sock *dp = dccp_sk(sk);
  64. struct dccp_minisock *dmsk = dccp_msk(sk);
  65. /* figure out if we are changing our CCID or the peer's */
  66. const int rx = type == DCCPO_CHANGE_R;
  67. const u8 ccid_nr = rx ? dmsk->dccpms_rx_ccid : dmsk->dccpms_tx_ccid;
  68. struct ccid *new_ccid;
  69. /* Check if nothing is being changed. */
  70. if (ccid_nr == new_ccid_nr)
  71. return 0;
  72. new_ccid = ccid_new(new_ccid_nr, sk, rx, GFP_ATOMIC);
  73. if (new_ccid == NULL)
  74. return -ENOMEM;
  75. if (rx) {
  76. ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
  77. dp->dccps_hc_rx_ccid = new_ccid;
  78. dmsk->dccpms_rx_ccid = new_ccid_nr;
  79. } else {
  80. ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
  81. dp->dccps_hc_tx_ccid = new_ccid;
  82. dmsk->dccpms_tx_ccid = new_ccid_nr;
  83. }
  84. return 0;
  85. }
  86. static int dccp_feat_update(struct sock *sk, u8 type, u8 feat, u8 val)
  87. {
  88. dccp_feat_debug(type, feat, val);
  89. switch (feat) {
  90. case DCCPF_CCID:
  91. return dccp_feat_update_ccid(sk, type, val);
  92. default:
  93. dccp_pr_debug("UNIMPLEMENTED: %s(%d, ...)\n",
  94. dccp_feat_typename(type), feat);
  95. break;
  96. }
  97. return 0;
  98. }
  99. static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt,
  100. u8 *rpref, u8 rlen)
  101. {
  102. struct dccp_sock *dp = dccp_sk(sk);
  103. u8 *spref, slen, *res = NULL;
  104. int i, j, rc, agree = 1;
  105. BUG_ON(rpref == NULL);
  106. /* check if we are the black sheep */
  107. if (dp->dccps_role == DCCP_ROLE_CLIENT) {
  108. spref = rpref;
  109. slen = rlen;
  110. rpref = opt->dccpop_val;
  111. rlen = opt->dccpop_len;
  112. } else {
  113. spref = opt->dccpop_val;
  114. slen = opt->dccpop_len;
  115. }
  116. /*
  117. * Now we have server preference list in spref and client preference in
  118. * rpref
  119. */
  120. BUG_ON(spref == NULL);
  121. BUG_ON(rpref == NULL);
  122. /* FIXME sanity check vals */
  123. /* Are values in any order? XXX Lame "algorithm" here */
  124. for (i = 0; i < slen; i++) {
  125. for (j = 0; j < rlen; j++) {
  126. if (spref[i] == rpref[j]) {
  127. res = &spref[i];
  128. break;
  129. }
  130. }
  131. if (res)
  132. break;
  133. }
  134. /* we didn't agree on anything */
  135. if (res == NULL) {
  136. /* confirm previous value */
  137. switch (opt->dccpop_feat) {
  138. case DCCPF_CCID:
  139. /* XXX did i get this right? =P */
  140. if (opt->dccpop_type == DCCPO_CHANGE_L)
  141. res = &dccp_msk(sk)->dccpms_tx_ccid;
  142. else
  143. res = &dccp_msk(sk)->dccpms_rx_ccid;
  144. break;
  145. default:
  146. DCCP_BUG("Fell through, feat=%d", opt->dccpop_feat);
  147. /* XXX implement res */
  148. return -EFAULT;
  149. }
  150. dccp_pr_debug("Don't agree... reconfirming %d\n", *res);
  151. agree = 0; /* this is used for mandatory options... */
  152. }
  153. /* need to put result and our preference list */
  154. rlen = 1 + opt->dccpop_len;
  155. rpref = kmalloc(rlen, GFP_ATOMIC);
  156. if (rpref == NULL)
  157. return -ENOMEM;
  158. *rpref = *res;
  159. memcpy(&rpref[1], opt->dccpop_val, opt->dccpop_len);
  160. /* put it in the "confirm queue" */
  161. if (opt->dccpop_sc == NULL) {
  162. opt->dccpop_sc = kmalloc(sizeof(*opt->dccpop_sc), GFP_ATOMIC);
  163. if (opt->dccpop_sc == NULL) {
  164. kfree(rpref);
  165. return -ENOMEM;
  166. }
  167. } else {
  168. /* recycle the confirm slot */
  169. BUG_ON(opt->dccpop_sc->dccpoc_val == NULL);
  170. kfree(opt->dccpop_sc->dccpoc_val);
  171. dccp_pr_debug("recycling confirm slot\n");
  172. }
  173. memset(opt->dccpop_sc, 0, sizeof(*opt->dccpop_sc));
  174. opt->dccpop_sc->dccpoc_val = rpref;
  175. opt->dccpop_sc->dccpoc_len = rlen;
  176. /* update the option on our side [we are about to send the confirm] */
  177. rc = dccp_feat_update(sk, opt->dccpop_type, opt->dccpop_feat, *res);
  178. if (rc) {
  179. kfree(opt->dccpop_sc->dccpoc_val);
  180. kfree(opt->dccpop_sc);
  181. opt->dccpop_sc = NULL;
  182. return rc;
  183. }
  184. dccp_pr_debug("Will confirm %d\n", *rpref);
  185. /* say we want to change to X but we just got a confirm X, suppress our
  186. * change
  187. */
  188. if (!opt->dccpop_conf) {
  189. if (*opt->dccpop_val == *res)
  190. opt->dccpop_conf = 1;
  191. dccp_pr_debug("won't ask for change of same feature\n");
  192. }
  193. return agree ? 0 : DCCP_FEAT_SP_NOAGREE; /* used for mandatory opts */
  194. }
  195. static int dccp_feat_sp(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len)
  196. {
  197. struct dccp_minisock *dmsk = dccp_msk(sk);
  198. struct dccp_opt_pend *opt;
  199. int rc = 1;
  200. u8 t;
  201. /*
  202. * We received a CHANGE. We gotta match it against our own preference
  203. * list. If we got a CHANGE_R it means it's a change for us, so we need
  204. * to compare our CHANGE_L list.
  205. */
  206. if (type == DCCPO_CHANGE_L)
  207. t = DCCPO_CHANGE_R;
  208. else
  209. t = DCCPO_CHANGE_L;
  210. /* find our preference list for this feature */
  211. list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) {
  212. if (opt->dccpop_type != t || opt->dccpop_feat != feature)
  213. continue;
  214. /* find the winner from the two preference lists */
  215. rc = dccp_feat_reconcile(sk, opt, val, len);
  216. break;
  217. }
  218. /* We didn't deal with the change. This can happen if we have no
  219. * preference list for the feature. In fact, it just shouldn't
  220. * happen---if we understand a feature, we should have a preference list
  221. * with at least the default value.
  222. */
  223. BUG_ON(rc == 1);
  224. return rc;
  225. }
  226. static int dccp_feat_nn(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len)
  227. {
  228. struct dccp_opt_pend *opt;
  229. struct dccp_minisock *dmsk = dccp_msk(sk);
  230. u8 *copy;
  231. int rc;
  232. /* NN features must be Change L (sec. 6.3.2) */
  233. if (type != DCCPO_CHANGE_L) {
  234. dccp_pr_debug("received %s for NN feature %d\n",
  235. dccp_feat_typename(type), feature);
  236. return -EFAULT;
  237. }
  238. /* XXX sanity check opt val */
  239. /* copy option so we can confirm it */
  240. opt = kzalloc(sizeof(*opt), GFP_ATOMIC);
  241. if (opt == NULL)
  242. return -ENOMEM;
  243. copy = kmemdup(val, len, GFP_ATOMIC);
  244. if (copy == NULL) {
  245. kfree(opt);
  246. return -ENOMEM;
  247. }
  248. opt->dccpop_type = DCCPO_CONFIRM_R; /* NN can only confirm R */
  249. opt->dccpop_feat = feature;
  250. opt->dccpop_val = copy;
  251. opt->dccpop_len = len;
  252. /* change feature */
  253. rc = dccp_feat_update(sk, type, feature, *val);
  254. if (rc) {
  255. kfree(opt->dccpop_val);
  256. kfree(opt);
  257. return rc;
  258. }
  259. dccp_feat_debug(type, feature, *copy);
  260. list_add_tail(&opt->dccpop_node, &dmsk->dccpms_conf);
  261. return 0;
  262. }
  263. static void dccp_feat_empty_confirm(struct dccp_minisock *dmsk,
  264. u8 type, u8 feature)
  265. {
  266. /* XXX check if other confirms for that are queued and recycle slot */
  267. struct dccp_opt_pend *opt = kzalloc(sizeof(*opt), GFP_ATOMIC);
  268. if (opt == NULL) {
  269. /* XXX what do we do? Ignoring should be fine. It's a change
  270. * after all =P
  271. */
  272. return;
  273. }
  274. switch (type) {
  275. case DCCPO_CHANGE_L:
  276. opt->dccpop_type = DCCPO_CONFIRM_R;
  277. break;
  278. case DCCPO_CHANGE_R:
  279. opt->dccpop_type = DCCPO_CONFIRM_L;
  280. break;
  281. default:
  282. DCCP_WARN("invalid type %d\n", type);
  283. kfree(opt);
  284. return;
  285. }
  286. opt->dccpop_feat = feature;
  287. opt->dccpop_val = NULL;
  288. opt->dccpop_len = 0;
  289. /* change feature */
  290. dccp_pr_debug("Empty %s(%d)\n", dccp_feat_typename(type), feature);
  291. list_add_tail(&opt->dccpop_node, &dmsk->dccpms_conf);
  292. }
  293. static void dccp_feat_flush_confirm(struct sock *sk)
  294. {
  295. struct dccp_minisock *dmsk = dccp_msk(sk);
  296. /* Check if there is anything to confirm in the first place */
  297. int yes = !list_empty(&dmsk->dccpms_conf);
  298. if (!yes) {
  299. struct dccp_opt_pend *opt;
  300. list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) {
  301. if (opt->dccpop_conf) {
  302. yes = 1;
  303. break;
  304. }
  305. }
  306. }
  307. if (!yes)
  308. return;
  309. /* OK there is something to confirm... */
  310. /* XXX check if packet is in flight? Send delayed ack?? */
  311. if (sk->sk_state == DCCP_OPEN)
  312. dccp_send_ack(sk);
  313. }
  314. int dccp_feat_change_recv(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len)
  315. {
  316. int rc;
  317. dccp_feat_debug(type, feature, *val);
  318. /* figure out if it's SP or NN feature */
  319. switch (feature) {
  320. /* deal with SP features */
  321. case DCCPF_CCID:
  322. rc = dccp_feat_sp(sk, type, feature, val, len);
  323. break;
  324. /* deal with NN features */
  325. case DCCPF_ACK_RATIO:
  326. rc = dccp_feat_nn(sk, type, feature, val, len);
  327. break;
  328. /* XXX implement other features */
  329. default:
  330. dccp_pr_debug("UNIMPLEMENTED: not handling %s(%d, ...)\n",
  331. dccp_feat_typename(type), feature);
  332. rc = -EFAULT;
  333. break;
  334. }
  335. /* check if there were problems changing features */
  336. if (rc) {
  337. /* If we don't agree on SP, we sent a confirm for old value.
  338. * However we propagate rc to caller in case option was
  339. * mandatory
  340. */
  341. if (rc != DCCP_FEAT_SP_NOAGREE)
  342. dccp_feat_empty_confirm(dccp_msk(sk), type, feature);
  343. }
  344. /* generate the confirm [if required] */
  345. dccp_feat_flush_confirm(sk);
  346. return rc;
  347. }
  348. EXPORT_SYMBOL_GPL(dccp_feat_change_recv);
  349. int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature,
  350. u8 *val, u8 len)
  351. {
  352. u8 t;
  353. struct dccp_opt_pend *opt;
  354. struct dccp_minisock *dmsk = dccp_msk(sk);
  355. int found = 0;
  356. int all_confirmed = 1;
  357. dccp_feat_debug(type, feature, *val);
  358. /* locate our change request */
  359. switch (type) {
  360. case DCCPO_CONFIRM_L: t = DCCPO_CHANGE_R; break;
  361. case DCCPO_CONFIRM_R: t = DCCPO_CHANGE_L; break;
  362. default: DCCP_WARN("invalid type %d\n", type);
  363. return 1;
  364. }
  365. /* XXX sanity check feature value */
  366. list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) {
  367. if (!opt->dccpop_conf && opt->dccpop_type == t &&
  368. opt->dccpop_feat == feature) {
  369. found = 1;
  370. dccp_pr_debug("feature %d found\n", opt->dccpop_feat);
  371. /* XXX do sanity check */
  372. opt->dccpop_conf = 1;
  373. /* We got a confirmation---change the option */
  374. dccp_feat_update(sk, opt->dccpop_type,
  375. opt->dccpop_feat, *val);
  376. /* XXX check the return value of dccp_feat_update */
  377. break;
  378. }
  379. if (!opt->dccpop_conf)
  380. all_confirmed = 0;
  381. }
  382. /* fix re-transmit timer */
  383. /* XXX gotta make sure that no option negotiation occurs during
  384. * connection shutdown. Consider that the CLOSEREQ is sent and timer is
  385. * on. if all options are confirmed it might kill timer which should
  386. * remain alive until close is received.
  387. */
  388. if (all_confirmed) {
  389. dccp_pr_debug("clear feat negotiation timer %p\n", sk);
  390. inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS);
  391. }
  392. if (!found)
  393. dccp_pr_debug("%s(%d, ...) never requested\n",
  394. dccp_feat_typename(type), feature);
  395. return 0;
  396. }
  397. EXPORT_SYMBOL_GPL(dccp_feat_confirm_recv);
  398. void dccp_feat_clean(struct dccp_minisock *dmsk)
  399. {
  400. struct dccp_opt_pend *opt, *next;
  401. list_for_each_entry_safe(opt, next, &dmsk->dccpms_pending,
  402. dccpop_node) {
  403. BUG_ON(opt->dccpop_val == NULL);
  404. kfree(opt->dccpop_val);
  405. if (opt->dccpop_sc != NULL) {
  406. BUG_ON(opt->dccpop_sc->dccpoc_val == NULL);
  407. kfree(opt->dccpop_sc->dccpoc_val);
  408. kfree(opt->dccpop_sc);
  409. }
  410. kfree(opt);
  411. }
  412. INIT_LIST_HEAD(&dmsk->dccpms_pending);
  413. list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) {
  414. BUG_ON(opt == NULL);
  415. if (opt->dccpop_val != NULL)
  416. kfree(opt->dccpop_val);
  417. kfree(opt);
  418. }
  419. INIT_LIST_HEAD(&dmsk->dccpms_conf);
  420. }
  421. EXPORT_SYMBOL_GPL(dccp_feat_clean);
  422. /* this is to be called only when a listening sock creates its child. It is
  423. * assumed by the function---the confirm is not duplicated, but rather it is
  424. * "passed on".
  425. */
  426. int dccp_feat_clone(struct sock *oldsk, struct sock *newsk)
  427. {
  428. struct dccp_minisock *olddmsk = dccp_msk(oldsk);
  429. struct dccp_minisock *newdmsk = dccp_msk(newsk);
  430. struct dccp_opt_pend *opt;
  431. int rc = 0;
  432. INIT_LIST_HEAD(&newdmsk->dccpms_pending);
  433. INIT_LIST_HEAD(&newdmsk->dccpms_conf);
  434. list_for_each_entry(opt, &olddmsk->dccpms_pending, dccpop_node) {
  435. struct dccp_opt_pend *newopt;
  436. /* copy the value of the option */
  437. u8 *val = kmemdup(opt->dccpop_val, opt->dccpop_len, GFP_ATOMIC);
  438. if (val == NULL)
  439. goto out_clean;
  440. newopt = kmemdup(opt, sizeof(*newopt), GFP_ATOMIC);
  441. if (newopt == NULL) {
  442. kfree(val);
  443. goto out_clean;
  444. }
  445. /* insert the option */
  446. newopt->dccpop_val = val;
  447. list_add_tail(&newopt->dccpop_node, &newdmsk->dccpms_pending);
  448. /* XXX what happens with backlogs and multiple connections at
  449. * once...
  450. */
  451. /* the master socket no longer needs to worry about confirms */
  452. opt->dccpop_sc = NULL; /* it's not a memleak---new socket has it */
  453. /* reset state for a new socket */
  454. opt->dccpop_conf = 0;
  455. }
  456. /* XXX not doing anything about the conf queue */
  457. out:
  458. return rc;
  459. out_clean:
  460. dccp_feat_clean(newdmsk);
  461. rc = -ENOMEM;
  462. goto out;
  463. }
  464. EXPORT_SYMBOL_GPL(dccp_feat_clone);
  465. static int __dccp_feat_init(struct dccp_minisock *dmsk, u8 type, u8 feat,
  466. u8 *val, u8 len)
  467. {
  468. int rc = -ENOMEM;
  469. u8 *copy = kmemdup(val, len, GFP_KERNEL);
  470. if (copy != NULL) {
  471. rc = dccp_feat_change(dmsk, type, feat, copy, len, GFP_KERNEL);
  472. if (rc)
  473. kfree(copy);
  474. }
  475. return rc;
  476. }
  477. int dccp_feat_init(struct dccp_minisock *dmsk)
  478. {
  479. int rc;
  480. INIT_LIST_HEAD(&dmsk->dccpms_pending);
  481. INIT_LIST_HEAD(&dmsk->dccpms_conf);
  482. /* CCID L */
  483. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_L, DCCPF_CCID,
  484. &dmsk->dccpms_tx_ccid, 1);
  485. if (rc)
  486. goto out;
  487. /* CCID R */
  488. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_R, DCCPF_CCID,
  489. &dmsk->dccpms_rx_ccid, 1);
  490. if (rc)
  491. goto out;
  492. /* Ack ratio */
  493. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_L, DCCPF_ACK_RATIO,
  494. &dmsk->dccpms_ack_ratio, 1);
  495. out:
  496. return rc;
  497. }
  498. EXPORT_SYMBOL_GPL(dccp_feat_init);
  499. #ifdef CONFIG_IP_DCCP_DEBUG
  500. const char *dccp_feat_typename(const u8 type)
  501. {
  502. switch(type) {
  503. case DCCPO_CHANGE_L: return("ChangeL");
  504. case DCCPO_CONFIRM_L: return("ConfirmL");
  505. case DCCPO_CHANGE_R: return("ChangeR");
  506. case DCCPO_CONFIRM_R: return("ConfirmR");
  507. /* the following case must not appear in feature negotation */
  508. default: dccp_pr_debug("unknown type %d [BUG!]\n", type);
  509. }
  510. return NULL;
  511. }
  512. EXPORT_SYMBOL_GPL(dccp_feat_typename);
  513. const char *dccp_feat_name(const u8 feat)
  514. {
  515. static const char *feature_names[] = {
  516. [DCCPF_RESERVED] = "Reserved",
  517. [DCCPF_CCID] = "CCID",
  518. [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos",
  519. [DCCPF_SEQUENCE_WINDOW] = "Sequence Window",
  520. [DCCPF_ECN_INCAPABLE] = "ECN Incapable",
  521. [DCCPF_ACK_RATIO] = "Ack Ratio",
  522. [DCCPF_SEND_ACK_VECTOR] = "Send ACK Vector",
  523. [DCCPF_SEND_NDP_COUNT] = "Send NDP Count",
  524. [DCCPF_MIN_CSUM_COVER] = "Min. Csum Coverage",
  525. [DCCPF_DATA_CHECKSUM] = "Send Data Checksum",
  526. };
  527. if (feat > DCCPF_DATA_CHECKSUM && feat < DCCPF_MIN_CCID_SPECIFIC)
  528. return feature_names[DCCPF_RESERVED];
  529. if (feat >= DCCPF_MIN_CCID_SPECIFIC)
  530. return "CCID-specific";
  531. return feature_names[feat];
  532. }
  533. EXPORT_SYMBOL_GPL(dccp_feat_name);
  534. #endif /* CONFIG_IP_DCCP_DEBUG */