hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/sctp/transport.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* SCTP kernel implementation
23 * Copyright (c) 1999-2000 Cisco, Inc.
34 * Copyright (c) 1999-2001 Motorola, Inc.
....@@ -10,22 +11,6 @@
1011 * This module provides the abstraction for an SCTP tranport representing
1112 * a remote transport address. For local transport addresses, we just use
1213 * union sctp_addr.
13
- *
14
- * This SCTP implementation is free software;
15
- * you can redistribute it and/or modify it under the terms of
16
- * the GNU General Public License as published by
17
- * the Free Software Foundation; either version 2, or (at your option)
18
- * any later version.
19
- *
20
- * This SCTP implementation is distributed in the hope that it
21
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied
22
- * ************************
23
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24
- * See the GNU General Public License for more details.
25
- *
26
- * You should have received a copy of the GNU General Public License
27
- * along with GNU CC; see the file COPYING. If not, see
28
- * <http://www.gnu.org/licenses/>.
2914 *
3015 * Please send any bug reports or fixes you make to the
3116 * email address(es):
....@@ -58,8 +43,8 @@
5843 gfp_t gfp)
5944 {
6045 /* Copy in the address. */
61
- peer->ipaddr = *addr;
6246 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family);
47
+ memcpy(&peer->ipaddr, addr, peer->af_specific->sockaddr_len);
6348 memset(&peer->saddr, 0, sizeof(union sctp_addr));
6449
6550 peer->sack_generation = 0;
....@@ -349,7 +334,7 @@
349334 pr_debug("%s: rto_pending not set on transport %p!\n", __func__, tp);
350335
351336 if (tp->rttvar || tp->srtt) {
352
- struct net *net = sock_net(tp->asoc->base.sk);
337
+ struct net *net = tp->asoc->base.net;
353338 /* 6.3.1 C3) When a new RTT measurement R' is made, set
354339 * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'|
355340 * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'