feat.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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. pr_info("option type %d invalid in negotiation\n", type);
  23. return 1;
  24. }
  25. if (!dccp_feat_is_valid_length(type, feature, len)) {
  26. pr_info("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. WARN_ON(1); /* XXX implement res */
  147. return -EFAULT;
  148. }
  149. dccp_pr_debug("Don't agree... reconfirming %d\n", *res);
  150. agree = 0; /* this is used for mandatory options... */
  151. }
  152. /* need to put result and our preference list */
  153. /* XXX assume 1 byte vals */
  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 = kmalloc(len, GFP_ATOMIC);
  244. if (copy == NULL) {
  245. kfree(opt);
  246. return -ENOMEM;
  247. }
  248. memcpy(copy, val, len);
  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: pr_info("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: pr_info("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 = kmalloc(opt->dccpop_len, GFP_ATOMIC);
  432. if (val == NULL)
  433. goto out_clean;
  434. memcpy(val, opt->dccpop_val, opt->dccpop_len);
  435. newopt = kmalloc(sizeof(*newopt), GFP_ATOMIC);
  436. if (newopt == NULL) {
  437. kfree(val);
  438. goto out_clean;
  439. }
  440. /* insert the option */
  441. memcpy(newopt, opt, sizeof(*newopt));
  442. newopt->dccpop_val = val;
  443. list_add_tail(&newopt->dccpop_node, &newdmsk->dccpms_pending);
  444. /* XXX what happens with backlogs and multiple connections at
  445. * once...
  446. */
  447. /* the master socket no longer needs to worry about confirms */
  448. opt->dccpop_sc = NULL; /* it's not a memleak---new socket has it */
  449. /* reset state for a new socket */
  450. opt->dccpop_conf = 0;
  451. }
  452. /* XXX not doing anything about the conf queue */
  453. out:
  454. return rc;
  455. out_clean:
  456. dccp_feat_clean(newdmsk);
  457. rc = -ENOMEM;
  458. goto out;
  459. }
  460. EXPORT_SYMBOL_GPL(dccp_feat_clone);
  461. static int __dccp_feat_init(struct dccp_minisock *dmsk, u8 type, u8 feat,
  462. u8 *val, u8 len)
  463. {
  464. int rc = -ENOMEM;
  465. u8 *copy = kmalloc(len, GFP_KERNEL);
  466. if (copy != NULL) {
  467. memcpy(copy, val, len);
  468. rc = dccp_feat_change(dmsk, type, feat, copy, len, GFP_KERNEL);
  469. if (rc)
  470. kfree(copy);
  471. }
  472. return rc;
  473. }
  474. int dccp_feat_init(struct dccp_minisock *dmsk)
  475. {
  476. int rc;
  477. INIT_LIST_HEAD(&dmsk->dccpms_pending);
  478. INIT_LIST_HEAD(&dmsk->dccpms_conf);
  479. /* CCID L */
  480. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_L, DCCPF_CCID,
  481. &dmsk->dccpms_tx_ccid, 1);
  482. if (rc)
  483. goto out;
  484. /* CCID R */
  485. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_R, DCCPF_CCID,
  486. &dmsk->dccpms_rx_ccid, 1);
  487. if (rc)
  488. goto out;
  489. /* Ack ratio */
  490. rc = __dccp_feat_init(dmsk, DCCPO_CHANGE_L, DCCPF_ACK_RATIO,
  491. &dmsk->dccpms_ack_ratio, 1);
  492. out:
  493. return rc;
  494. }
  495. EXPORT_SYMBOL_GPL(dccp_feat_init);
  496. #ifdef CONFIG_IP_DCCP_DEBUG
  497. const char *dccp_feat_typename(const u8 type)
  498. {
  499. switch(type) {
  500. case DCCPO_CHANGE_L: return("ChangeL");
  501. case DCCPO_CONFIRM_L: return("ConfirmL");
  502. case DCCPO_CHANGE_R: return("ChangeR");
  503. case DCCPO_CONFIRM_R: return("ConfirmR");
  504. /* the following case must not appear in feature negotation */
  505. default: dccp_pr_debug("unknown type %d [BUG!]\n", type);
  506. }
  507. return NULL;
  508. }
  509. EXPORT_SYMBOL_GPL(dccp_feat_typename);
  510. const char *dccp_feat_name(const u8 feat)
  511. {
  512. static const char *feature_names[] = {
  513. [DCCPF_RESERVED] = "Reserved",
  514. [DCCPF_CCID] = "CCID",
  515. [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos",
  516. [DCCPF_SEQUENCE_WINDOW] = "Sequence Window",
  517. [DCCPF_ECN_INCAPABLE] = "ECN Incapable",
  518. [DCCPF_ACK_RATIO] = "Ack Ratio",
  519. [DCCPF_SEND_ACK_VECTOR] = "Send ACK Vector",
  520. [DCCPF_SEND_NDP_COUNT] = "Send NDP Count",
  521. [DCCPF_MIN_CSUM_COVER] = "Min. Csum Coverage",
  522. [DCCPF_DATA_CHECKSUM] = "Send Data Checksum",
  523. };
  524. if (feat >= DCCPF_MIN_CCID_SPECIFIC)
  525. return "CCID-specific";
  526. if (dccp_feat_is_reserved(feat))
  527. return feature_names[DCCPF_RESERVED];
  528. return feature_names[feat];
  529. }
  530. EXPORT_SYMBOL_GPL(dccp_feat_name);
  531. #endif /* CONFIG_IP_DCCP_DEBUG */