fcoe-utils/0015-fipvlan-break-out-of-receive-loop-on-error.patch

37 lines
1.0 KiB
Diff
Raw Normal View History

From 78ea81aaef57b5b40fdc86335a7e6a432a72ad48 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 19 Nov 2013 20:26:12 +0000
Subject: fipvlan: break out of receive loop on error
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 <hare@suse.de>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
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