Browse Source

[iscsi] Treat redirection failures as fatal

Debugged-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
55f7a675d6
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      src/net/tcp/iscsi.c

+ 10
- 1
src/net/tcp/iscsi.c View File

@@ -1710,6 +1710,7 @@ static int iscsi_vredirect ( struct iscsi_session *iscsi, int type,
1710 1710
 			     va_list args ) {
1711 1711
 	va_list tmp;
1712 1712
 	struct sockaddr *peer;
1713
+	int rc;
1713 1714
 
1714 1715
 	/* Intercept redirects to a LOCATION_SOCKET and record the IP
1715 1716
 	 * address for the iBFT.  This is a bit of a hack, but avoids
@@ -1725,7 +1726,15 @@ static int iscsi_vredirect ( struct iscsi_session *iscsi, int type,
1725 1726
 		va_end ( tmp );
1726 1727
 	}
1727 1728
 
1728
-	return xfer_vreopen ( &iscsi->socket, type, args );
1729
+	/* Redirect to new location */
1730
+	if ( ( rc = xfer_vreopen ( &iscsi->socket, type, args ) ) != 0 )
1731
+		goto err;
1732
+
1733
+	return 0;
1734
+
1735
+ err:
1736
+	iscsi_close ( iscsi, rc );
1737
+	return rc;
1729 1738
 }
1730 1739
 
1731 1740
 /** iSCSI socket interface operations */

Loading…
Cancel
Save