| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* SCTP kernel implementation |
|---|
| 2 | 3 | * Copyright (c) 1999-2000 Cisco, Inc. |
|---|
| 3 | 4 | * Copyright (c) 1999-2001 Motorola, Inc. |
|---|
| .. | .. |
|---|
| 10 | 11 | * This module provides the abstraction for an SCTP tranport representing |
|---|
| 11 | 12 | * a remote transport address. For local transport addresses, we just use |
|---|
| 12 | 13 | * 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/>. |
|---|
| 29 | 14 | * |
|---|
| 30 | 15 | * Please send any bug reports or fixes you make to the |
|---|
| 31 | 16 | * email address(es): |
|---|
| .. | .. |
|---|
| 58 | 43 | gfp_t gfp) |
|---|
| 59 | 44 | { |
|---|
| 60 | 45 | /* Copy in the address. */ |
|---|
| 61 | | - peer->ipaddr = *addr; |
|---|
| 62 | 46 | peer->af_specific = sctp_get_af_specific(addr->sa.sa_family); |
|---|
| 47 | + memcpy(&peer->ipaddr, addr, peer->af_specific->sockaddr_len); |
|---|
| 63 | 48 | memset(&peer->saddr, 0, sizeof(union sctp_addr)); |
|---|
| 64 | 49 | |
|---|
| 65 | 50 | peer->sack_generation = 0; |
|---|
| .. | .. |
|---|
| 349 | 334 | pr_debug("%s: rto_pending not set on transport %p!\n", __func__, tp); |
|---|
| 350 | 335 | |
|---|
| 351 | 336 | if (tp->rttvar || tp->srtt) { |
|---|
| 352 | | - struct net *net = sock_net(tp->asoc->base.sk); |
|---|
| 337 | + struct net *net = tp->asoc->base.net; |
|---|
| 353 | 338 | /* 6.3.1 C3) When a new RTT measurement R' is made, set |
|---|
| 354 | 339 | * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| |
|---|
| 355 | 340 | * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' |
|---|