hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/sctp/sm_statetable.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* SCTP kernel implementation
23 * (C) Copyright IBM Corp. 2001, 2004
34 * Copyright (c) 1999-2000 Cisco, Inc.
....@@ -8,22 +9,6 @@
89 * This file is part of the SCTP kernel implementation
910 *
1011 * These are the state tables for the SCTP state machine.
11
- *
12
- * This SCTP implementation is free software;
13
- * you can redistribute it and/or modify it under the terms of
14
- * the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2, or (at your option)
16
- * any later version.
17
- *
18
- * This SCTP implementation is distributed in the hope that it
19
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied
20
- * ************************
21
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- * See the GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with GNU CC; see the file COPYING. If not, see
26
- * <http://www.gnu.org/licenses/>.
2712 *
2813 * Please send any bug reports or fixes you make to the
2914 * email address(es):
....@@ -79,7 +64,7 @@
7964
8065 const struct sctp_sm_table_entry *sctp_sm_lookup_event(
8166 struct net *net,
82
- enum sctp_event event_type,
67
+ enum sctp_event_type event_type,
8368 enum sctp_state state,
8469 union sctp_subtype event_subtype)
8570 {
....@@ -991,26 +976,22 @@
991976 if (cid <= SCTP_CID_BASE_MAX)
992977 return &chunk_event_table[cid][state];
993978
994
- if (net->sctp.prsctp_enable) {
995
- if (cid == SCTP_CID_FWD_TSN || cid == SCTP_CID_I_FWD_TSN)
996
- return &prsctp_chunk_event_table[0][state];
997
- }
979
+ switch ((u16)cid) {
980
+ case SCTP_CID_FWD_TSN:
981
+ case SCTP_CID_I_FWD_TSN:
982
+ return &prsctp_chunk_event_table[0][state];
998983
999
- if (net->sctp.addip_enable) {
1000
- if (cid == SCTP_CID_ASCONF)
1001
- return &addip_chunk_event_table[0][state];
984
+ case SCTP_CID_ASCONF:
985
+ return &addip_chunk_event_table[0][state];
1002986
1003
- if (cid == SCTP_CID_ASCONF_ACK)
1004
- return &addip_chunk_event_table[1][state];
1005
- }
987
+ case SCTP_CID_ASCONF_ACK:
988
+ return &addip_chunk_event_table[1][state];
1006989
1007
- if (net->sctp.reconf_enable)
1008
- if (cid == SCTP_CID_RECONF)
1009
- return &reconf_chunk_event_table[0][state];
990
+ case SCTP_CID_RECONF:
991
+ return &reconf_chunk_event_table[0][state];
1010992
1011
- if (net->sctp.auth_enable) {
1012
- if (cid == SCTP_CID_AUTH)
1013
- return &auth_chunk_event_table[0][state];
993
+ case SCTP_CID_AUTH:
994
+ return &auth_chunk_event_table[0][state];
1014995 }
1015996
1016997 return &chunk_event_table_unknown[state];