.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* SCTP kernel implementation |
---|
2 | 3 | * (C) Copyright IBM Corp. 2001, 2004 |
---|
3 | 4 | * Copyright (c) 1999-2000 Cisco, Inc. |
---|
.. | .. |
---|
7 | 8 | * This file is part of the SCTP kernel implementation |
---|
8 | 9 | * |
---|
9 | 10 | * 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/>. |
---|
26 | 11 | * |
---|
27 | 12 | * Please send any bug reports or fixes you make to the |
---|
28 | 13 | * email address(es): |
---|
.. | .. |
---|
151 | 136 | * sctp/input.c |
---|
152 | 137 | */ |
---|
153 | 138 | 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); |
---|
156 | 141 | void sctp_unhash_endpoint(struct sctp_endpoint *); |
---|
157 | 142 | struct sock *sctp_err_lookup(struct net *net, int family, struct sk_buff *, |
---|
158 | 143 | struct sctphdr *, struct sctp_association **, |
---|
.. | .. |
---|
306 | 291 | #define SCTP_DBG_OBJCNT(name) \ |
---|
307 | 292 | atomic_t sctp_dbg_objcnt_## name = ATOMIC_INIT(0) |
---|
308 | 293 | |
---|
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 |
---|
310 | 295 | * objcnt counters. |
---|
311 | 296 | */ |
---|
312 | 297 | #define SCTP_DBG_OBJCNT_ENTRY(name) \ |
---|
.. | .. |
---|
421 | 406 | /* |
---|
422 | 407 | * This mimics the behavior of skb_set_owner_r |
---|
423 | 408 | */ |
---|
424 | | - sk->sk_forward_alloc -= event->rmem_len; |
---|
| 409 | + sk_mem_charge(sk, event->rmem_len); |
---|
425 | 410 | } |
---|
426 | 411 | |
---|
427 | 412 | /* Tests if the list has one and only one entry. */ |
---|
428 | 413 | static inline int sctp_list_single_entry(struct list_head *head) |
---|
429 | 414 | { |
---|
430 | | - return (head->next != head) && (head->next == head->prev); |
---|
| 415 | + return list_is_singular(head); |
---|
431 | 416 | } |
---|
432 | 417 | |
---|
433 | 418 | static inline bool sctp_chunk_pending(const struct sctp_chunk *chunk) |
---|
.. | .. |
---|
630 | 615 | return sock_flag(sk, SOCK_DEAD) || sk->sk_socket; |
---|
631 | 616 | } |
---|
632 | 617 | |
---|
| 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 | + |
---|
633 | 625 | #endif /* __net_sctp_h__ */ |
---|