[PATCH] net/rds: Drop duplicate sin and sin6 assignments

Subsystems: networking [general], rds - reliable datagram sockets, the rest

STALE1974d

2 messages, 2 authors, 2021-03-10 · open the first message on its own page

[PATCH] net/rds: Drop duplicate sin and sin6 assignments

From: Yejune Deng <hidden>
Date: 2021-03-10 03:24:28

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 <redacted>
---
 net/rds/recv.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/net/rds/recv.c b/net/rds/recv.c
index aba4afe4dfed..4db109fb6ec2 100644
--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -722,8 +722,6 @@ 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 =
@@ -731,8 +729,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 				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;
-- 
2.29.0

Re: [PATCH] net/rds: Drop duplicate sin and sin6 assignments

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-03-10 21:01:18

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 10 Mar 2021 11:23:43 +0800 you wrote:
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 <redacted>
---
 net/rds/recv.c | 4 ----
 1 file changed, 4 deletions(-)
Here is the summary with links:
  - net/rds: Drop duplicate sin and sin6 assignments
    https://git.kernel.org/netdev/net-next/c/3e6f20e09a45

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help