hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/include/net/sctp/sctp.h
....@@ -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.
....@@ -7,22 +8,6 @@
78 * This file is part of the SCTP kernel implementation
89 *
910 * The base lksctp header.
10
- *
11
- * This SCTP implementation is free software;
12
- * you can redistribute it and/or modify it under the terms of
13
- * the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2, or (at your option)
15
- * any later version.
16
- *
17
- * This SCTP implementation is distributed in the hope that it
18
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied
19
- * ************************
20
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21
- * See the GNU General Public License for more details.
22
- *
23
- * You should have received a copy of the GNU General Public License
24
- * along with GNU CC; see the file COPYING. If not, see
25
- * <http://www.gnu.org/licenses/>.
2611 *
2712 * Please send any bug reports or fixes you make to the
2813 * email address(es):
....@@ -151,8 +136,8 @@
151136 * sctp/input.c
152137 */
153138 int sctp_rcv(struct sk_buff *skb);
154
-void sctp_v4_err(struct sk_buff *skb, u32 info);
155
-void sctp_hash_endpoint(struct sctp_endpoint *);
139
+int sctp_v4_err(struct sk_buff *skb, u32 info);
140
+int sctp_hash_endpoint(struct sctp_endpoint *ep);
156141 void sctp_unhash_endpoint(struct sctp_endpoint *);
157142 struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *,
158143 struct sctphdr *, struct sctp_association **,
....@@ -306,7 +291,7 @@
306291 #define SCTP_DBG_OBJCNT(name) \
307292 atomic_t sctp_dbg_objcnt_## name = ATOMIC_INIT(0)
308293
309
-/* Macro to help create new entries in in the global array of
294
+/* Macro to help create new entries in the global array of
310295 * objcnt counters.
311296 */
312297 #define SCTP_DBG_OBJCNT_ENTRY(name) \
....@@ -421,13 +406,13 @@
421406 /*
422407 * This mimics the behavior of skb_set_owner_r
423408 */
424
- sk->sk_forward_alloc -= event->rmem_len;
409
+ sk_mem_charge(sk, event->rmem_len);
425410 }
426411
427412 /* Tests if the list has one and only one entry. */
428413 static inline int sctp_list_single_entry(struct list_head *head)
429414 {
430
- return (head->next != head) && (head->next == head->prev);
415
+ return list_is_singular(head);
431416 }
432417
433418 static inline bool sctp_chunk_pending(const struct sctp_chunk *chunk)
....@@ -630,4 +615,11 @@
630615 return sock_flag(sk, SOCK_DEAD) || sk->sk_socket;
631616 }
632617
618
+static inline void sctp_sock_set_nodelay(struct sock *sk)
619
+{
620
+ lock_sock(sk);
621
+ sctp_sk(sk)->nodelay = true;
622
+ release_sock(sk);
623
+}
624
+
633625 #endif /* __net_sctp_h__ */