You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/19 12:19:47 UTC

[GitHub] [incubator-nuttx] GUIDINGLI opened a new pull request #4179: Update socket rpmsg

GUIDINGLI opened a new pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179


   ## Summary
   
    socket_rpmsg: fix recv block when remote close early
    socket_rpmsg: add lock to bind list, reject if list more than backlog
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672279701



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       ```suggestion
             rpmsg_socket_unlock(&server->recvlock);
   ```
   Shouldn't you unlock here instead?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672395696



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       Yes, you are right !




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672279701



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       ```suggestion
             rpmsg_socket_unlock(&server->recvlock);
   ```
   Shouldn't you unlock here instead?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672407804



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -510,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_unlock(&server->recvlock);

Review comment:
       move before line 513




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672395696



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       Yes, you are right !




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] GUIDINGLI commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
GUIDINGLI commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672395696



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       Yes, you are right !




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672407804



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -510,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_unlock(&server->recvlock);

Review comment:
       move before line 513




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672279701



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -505,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_lock(&server->recvlock);

Review comment:
       ```suggestion
             rpmsg_socket_unlock(&server->recvlock);
   ```
   Shouldn't you unlock here instead?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179#discussion_r672407804



##########
File path: net/rpmsg/rpmsg_sockif.c
##########
@@ -510,8 +502,25 @@ static void rpmsg_socket_ns_bind(FAR struct rpmsg_device *rdev,
   strcpy(new->rpaddr.rp_cpu, rpmsg_get_cpuname(rdev));
   strcpy(new->rpaddr.rp_name, name);
 
+  rpmsg_socket_lock(&server->recvlock);
+
+  for (tmp = server; tmp->next; tmp = tmp->next)
+    {
+      if (++cnt >= server->backlog)
+        {
+          /* Reject the connection */
+
+          rpmsg_destroy_ept(&new->ept);
+          rpmsg_socket_free(new);
+          rpmsg_socket_unlock(&server->recvlock);

Review comment:
       move before line 513




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] gustavonihei merged pull request #4179: Update socket rpmsg

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #4179:
URL: https://github.com/apache/incubator-nuttx/pull/4179


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org