feat.c 16 KB

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