Skip to content

Commit 230714b

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
local: correct shutdown state when use UDP mode
Signed-off-by: ligd <[email protected]>
1 parent 9fb8a17 commit 230714b

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

net/local/local_recvmsg.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -539,19 +539,11 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
539539
ssize_t local_recvmsg(FAR struct socket *psock, FAR struct msghdr *msg,
540540
int flags)
541541
{
542-
FAR struct local_conn_s *conn = psock->s_conn;
543542
FAR socklen_t *fromlen = &msg->msg_namelen;
544543
FAR struct sockaddr *from = msg->msg_name;
545544
FAR void *buf = msg->msg_iov->iov_base;
546545
size_t len = msg->msg_iov->iov_len;
547546

548-
/* Check shutdown state */
549-
550-
if (conn->lc_infile.f_inode == NULL)
551-
{
552-
return 0;
553-
}
554-
555547
if (msg->msg_iovlen != 1)
556548
{
557549
return -ENOTSUP;

net/local/local_sendmsg.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,20 +431,13 @@ static ssize_t local_sendto(FAR struct socket *psock,
431431
ssize_t local_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
432432
int flags)
433433
{
434-
FAR struct local_conn_s *conn = psock->s_conn;
435434
FAR const struct sockaddr *to = msg->msg_name;
436435
FAR const struct iovec *buf = msg->msg_iov;
437436
socklen_t tolen = msg->msg_namelen;
438437
size_t len = msg->msg_iovlen;
439438

440-
/* Check shutdown state */
441-
442-
if (conn->lc_outfile.f_inode == NULL)
443-
{
444-
return -EPIPE;
445-
}
446-
447439
#ifdef CONFIG_NET_LOCAL_SCM
440+
FAR struct local_conn_s *conn = psock->s_conn;
448441
int count = 0;
449442

450443
if (msg->msg_control &&

0 commit comments

Comments
 (0)