Skip to content

Commit

Permalink
net/rds: Drop duplicate sin and sin6 assignments
Browse files Browse the repository at this point in the history
There is no need to assign the msg->msg_name to sin or sin6,
because there is DECLARE_SOCKADDR statement.

Signed-off-by: Yejune Deng <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
YajunDeng authored and davem330 committed Mar 10, 2021
1 parent 4b18d5d commit 3e6f20e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/rds/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,17 +722,13 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,

if (msg->msg_name) {
if (ipv6_addr_v4mapped(&inc->i_saddr)) {
sin = (struct sockaddr_in *)msg->msg_name;

sin->sin_family = AF_INET;
sin->sin_port = inc->i_hdr.h_sport;
sin->sin_addr.s_addr =
inc->i_saddr.s6_addr32[3];
memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
msg->msg_namelen = sizeof(*sin);
} else {
sin6 = (struct sockaddr_in6 *)msg->msg_name;

sin6->sin6_family = AF_INET6;
sin6->sin6_port = inc->i_hdr.h_sport;
sin6->sin6_addr = inc->i_saddr;
Expand Down

0 comments on commit 3e6f20e

Please sign in to comment.