hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/dccp/feat.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * net/dccp/feat.c
34 *
....@@ -7,7 +8,6 @@
78 * Rewrote from scratch, some bits from earlier code by
89 * Copyright (c) 2005 Andrea Bittau <a.bittau@cs.ucl.ac.uk>
910 *
10
- *
1111 * ASSUMPTIONS
1212 * -----------
1313 * o Feature negotiation is coordinated with connection setup (as in TCP), wild
....@@ -16,11 +16,6 @@
1616 * o All currently known SP features have 1-byte quantities. If in the future
1717 * extensions of RFCs 4340..42 define features with item lengths larger than
1818 * one byte, a feature-specific extension of the code will be required.
19
- *
20
- * This program is free software; you can redistribute it and/or
21
- * modify it under the terms of the GNU General Public License
22
- * as published by the Free Software Foundation; either version
23
- * 2 of the License, or (at your option) any later version.
2419 */
2520 #include <linux/module.h>
2621 #include <linux/slab.h>
....@@ -170,6 +165,8 @@
170165
171166 /**
172167 * dccp_feat_index - Hash function to map feature number into array position
168
+ * @feat_num: feature to hash, one of %dccp_feature_numbers
169
+ *
173170 * Returns consecutive array index or -1 if the feature is not understood.
174171 */
175172 static int dccp_feat_index(u8 feat_num)
....@@ -572,6 +569,8 @@
572569
573570 /**
574571 * dccp_feat_valid_nn_length - Enforce length constraints on NN options
572
+ * @feat_num: feature to return length of, one of %dccp_feature_numbers
573
+ *
575574 * Length is between 0 and %DCCP_OPTVAL_MAXLEN. Used for outgoing packets only,
576575 * incoming options are accepted as long as their values are valid.
577576 */
....@@ -1408,7 +1407,8 @@
14081407 * Negotiation during connection setup
14091408 */
14101409 case DCCP_LISTEN:
1411
- server = true; /* fall through */
1410
+ server = true;
1411
+ fallthrough;
14121412 case DCCP_REQUESTING:
14131413 switch (opt) {
14141414 case DCCPO_CHANGE_L:
....@@ -1434,6 +1434,8 @@
14341434
14351435 /**
14361436 * dccp_feat_init - Seed feature negotiation with host-specific defaults
1437
+ * @sk: Socket to initialize.
1438
+ *
14371439 * This initialises global defaults, depending on the value of the sysctls.
14381440 * These can later be overridden by registering changes via setsockopt calls.
14391441 * The last link in the chain is finalise_settings, to make sure that between