.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * net/dccp/feat.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Rewrote from scratch, some bits from earlier code by |
---|
8 | 9 | * Copyright (c) 2005 Andrea Bittau <a.bittau@cs.ucl.ac.uk> |
---|
9 | 10 | * |
---|
10 | | - * |
---|
11 | 11 | * ASSUMPTIONS |
---|
12 | 12 | * ----------- |
---|
13 | 13 | * o Feature negotiation is coordinated with connection setup (as in TCP), wild |
---|
.. | .. |
---|
16 | 16 | * o All currently known SP features have 1-byte quantities. If in the future |
---|
17 | 17 | * extensions of RFCs 4340..42 define features with item lengths larger than |
---|
18 | 18 | * 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. |
---|
24 | 19 | */ |
---|
25 | 20 | #include <linux/module.h> |
---|
26 | 21 | #include <linux/slab.h> |
---|
.. | .. |
---|
170 | 165 | |
---|
171 | 166 | /** |
---|
172 | 167 | * dccp_feat_index - Hash function to map feature number into array position |
---|
| 168 | + * @feat_num: feature to hash, one of %dccp_feature_numbers |
---|
| 169 | + * |
---|
173 | 170 | * Returns consecutive array index or -1 if the feature is not understood. |
---|
174 | 171 | */ |
---|
175 | 172 | static int dccp_feat_index(u8 feat_num) |
---|
.. | .. |
---|
572 | 569 | |
---|
573 | 570 | /** |
---|
574 | 571 | * 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 | + * |
---|
575 | 574 | * Length is between 0 and %DCCP_OPTVAL_MAXLEN. Used for outgoing packets only, |
---|
576 | 575 | * incoming options are accepted as long as their values are valid. |
---|
577 | 576 | */ |
---|
.. | .. |
---|
1408 | 1407 | * Negotiation during connection setup |
---|
1409 | 1408 | */ |
---|
1410 | 1409 | case DCCP_LISTEN: |
---|
1411 | | - server = true; /* fall through */ |
---|
| 1410 | + server = true; |
---|
| 1411 | + fallthrough; |
---|
1412 | 1412 | case DCCP_REQUESTING: |
---|
1413 | 1413 | switch (opt) { |
---|
1414 | 1414 | case DCCPO_CHANGE_L: |
---|
.. | .. |
---|
1434 | 1434 | |
---|
1435 | 1435 | /** |
---|
1436 | 1436 | * dccp_feat_init - Seed feature negotiation with host-specific defaults |
---|
| 1437 | + * @sk: Socket to initialize. |
---|
| 1438 | + * |
---|
1437 | 1439 | * This initialises global defaults, depending on the value of the sysctls. |
---|
1438 | 1440 | * These can later be overridden by registering changes via setsockopt calls. |
---|
1439 | 1441 | * The last link in the chain is finalise_settings, to make sure that between |
---|