diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 894c278c8cdc..d47d5787e2e5 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -4315,6 +4315,9 @@ static int sctp_copy_laddrs_old(struct sock *sk, __u16 port, | |||
4315 | (AF_INET6 == addr->a.sa.sa_family)) | 4315 | (AF_INET6 == addr->a.sa.sa_family)) |
4316 | continue; | 4316 | continue; |
4317 | memcpy(&temp, &addr->a, sizeof(temp)); | 4317 | memcpy(&temp, &addr->a, sizeof(temp)); |
4318 | if (!temp.v4.sin_port) | ||
4319 | temp.v4.sin_port = htons(port); | ||
4320 | |||
4318 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), | 4321 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), |
4319 | &temp); | 4322 | &temp); |
4320 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 4323 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |
@@ -4347,6 +4350,9 @@ static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to, | |||
4347 | (AF_INET6 == addr->a.sa.sa_family)) | 4350 | (AF_INET6 == addr->a.sa.sa_family)) |
4348 | continue; | 4351 | continue; |
4349 | memcpy(&temp, &addr->a, sizeof(temp)); | 4352 | memcpy(&temp, &addr->a, sizeof(temp)); |
4353 | if (!temp.v4.sin_port) | ||
4354 | temp.v4.sin_port = htons(port); | ||
4355 | |||
4350 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), | 4356 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sctp_sk(sk), |
4351 | &temp); | 4357 | &temp); |
4352 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; | 4358 | addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; |