summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-10-21 03:49:10 +0300
committerJakub Kicinski <kuba@kernel.org>2022-10-21 03:49:10 +0300
commit94adb5e29e0e583283183dbaa852ee9d7d0c4c26 (patch)
tree3038a63f3ed9632711100f1187c4c53c304b785b /net/sctp
parent36875a063b5e3618b42f7bace850473bb88a7c24 (diff)
parent6d36c728bc2e2d632f4b0dea00df5532e20dfdab (diff)
downloadlinux-94adb5e29e0e583283183dbaa852ee9d7d0c4c26.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 171f1a35d205..83628c347744 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -8319,7 +8319,7 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
inet_get_local_port_range(net, &low, &high);
remaining = (high - low) + 1;
- rover = prandom_u32() % remaining + low;
+ rover = prandom_u32_max(remaining) + low;
do {
rover++;
@@ -9448,7 +9448,7 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk,
newinet->inet_rcv_saddr = inet->inet_rcv_saddr;
newinet->inet_dport = htons(asoc->peer.port);
newinet->pmtudisc = inet->pmtudisc;
- newinet->inet_id = prandom_u32();
+ newinet->inet_id = get_random_u16();
newinet->uc_ttl = inet->uc_ttl;
newinet->mc_loop = 1;