udp: Remove the unnessary check of addr size in udp_readahead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-09-05 14:08:13 +08:00 committed by Petro Karashchenko
parent 7f26b92130
commit ed85055edb
1 changed files with 6 additions and 16 deletions

View File

@ -257,24 +257,14 @@ static inline void udp_readahead(struct udp_recvfrom_s *pstate)
}
#endif
if (0
#ifdef CONFIG_NET_IPv6
|| src_addr_size == sizeof(struct sockaddr_in6)
#endif
#ifdef CONFIG_NET_IPv4
|| src_addr_size == sizeof(struct sockaddr_in)
#endif
)
if (pstate->ir_msg->msg_name)
{
if (pstate->ir_msg->msg_name)
{
pstate->ir_msg->msg_namelen =
src_addr_size > pstate->ir_msg->msg_namelen ?
pstate->ir_msg->msg_namelen : src_addr_size;
pstate->ir_msg->msg_namelen =
src_addr_size > pstate->ir_msg->msg_namelen ?
pstate->ir_msg->msg_namelen : src_addr_size;
memcpy(pstate->ir_msg->msg_name, srcaddr,
pstate->ir_msg->msg_namelen);
}
memcpy(pstate->ir_msg->msg_name, srcaddr,
pstate->ir_msg->msg_namelen);
}
if (pstate->ir_msg->msg_iov->iov_len > 0)