When fip_recv() returns an error we need to break out of the
receive loop; otherwise we might be stuck in there forever.

Signed-off-by: Hannes Reinecke <[email protected]>
---
 fipvlan.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fipvlan.c b/fipvlan.c
index 3c91930..198f0ee 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -772,8 +772,12 @@ static void recv_loop(int timeout)
                        rtnl_recv(pfd[0].fd, rtnl_listener_handler, NULL);
                /* everything else should be FIP packet sockets */
                for (i = 1; i < pfd_len; i++) {
-                       if (pfd[i].revents & POLLIN)
-                               fip_recv(pfd[i].fd, fip_vlan_handler, NULL);
+                       if (pfd[i].revents & POLLIN) {
+                               rc = fip_recv(pfd[i].fd, fip_vlan_handler,
+                                             NULL);
+                               if (rc < 0)
+                                       break;
+                       }
                }
        }
 }
-- 
1.8.1.4

_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

Reply via email to