aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a7e4729e974b..77bd16fa9f34 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -223,7 +223,7 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
223 inet_get_local_port_range(net, &low, &high); 223 inet_get_local_port_range(net, &low, &high);
224 remaining = (high - low) + 1; 224 remaining = (high - low) + 1;
225 225
226 rand = net_random(); 226 rand = prandom_u32();
227 first = (((u64)rand * remaining) >> 32) + low; 227 first = (((u64)rand * remaining) >> 32) + low;
228 /* 228 /*
229 * force rand to be an odd multiple of UDP_HTABLE_SIZE 229 * force rand to be an odd multiple of UDP_HTABLE_SIZE
@@ -902,7 +902,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
902 * Get and verify the address. 902 * Get and verify the address.
903 */ 903 */
904 if (msg->msg_name) { 904 if (msg->msg_name) {
905 struct sockaddr_in *usin = (struct sockaddr_in *)msg->msg_name; 905 DECLARE_SOCKADDR(struct sockaddr_in *, usin, msg->msg_name);
906 if (msg->msg_namelen < sizeof(*usin)) 906 if (msg->msg_namelen < sizeof(*usin))
907 return -EINVAL; 907 return -EINVAL;
908 if (usin->sin_family != AF_INET) { 908 if (usin->sin_family != AF_INET) {
@@ -986,7 +986,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
986 fl4 = &fl4_stack; 986 fl4 = &fl4_stack;
987 flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos, 987 flowi4_init_output(fl4, ipc.oif, sk->sk_mark, tos,
988 RT_SCOPE_UNIVERSE, sk->sk_protocol, 988 RT_SCOPE_UNIVERSE, sk->sk_protocol,
989 inet_sk_flowi_flags(sk)|FLOWI_FLAG_CAN_SLEEP, 989 inet_sk_flowi_flags(sk),
990 faddr, saddr, dport, inet->inet_sport); 990 faddr, saddr, dport, inet->inet_sport);
991 991
992 security_sk_classify_flow(sk, flowi4_to_flowi(fl4)); 992 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
@@ -1226,7 +1226,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1226 size_t len, int noblock, int flags, int *addr_len) 1226 size_t len, int noblock, int flags, int *addr_len)
1227{ 1227{
1228 struct inet_sock *inet = inet_sk(sk); 1228 struct inet_sock *inet = inet_sk(sk);
1229 struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; 1229 DECLARE_SOCKADDR(struct sockaddr_in *, sin, msg->msg_name);
1230 struct sk_buff *skb; 1230 struct sk_buff *skb;
1231 unsigned int ulen, copied; 1231 unsigned int ulen, copied;
1232 int peeked, off = 0; 1232 int peeked, off = 0;