diff options
author | Michael Brown <mcb30@ipxe.org> | 2016-07-04 16:14:22 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2016-07-04 16:20:07 +0100 |
commit | 55f7a675d61f8b83478e71d4f9efb3a1b789eb08 (patch) | |
tree | 1c4b1cadc5da0d7fc283f9007eb9fe6d2d203798 /src | |
parent | 89c6db838fc795c113e0584de0230cf86225135b (diff) | |
download | ipxe-55f7a675d61f8b83478e71d4f9efb3a1b789eb08.zip ipxe-55f7a675d61f8b83478e71d4f9efb3a1b789eb08.tar.gz ipxe-55f7a675d61f8b83478e71d4f9efb3a1b789eb08.tar.bz2 |
[iscsi] Treat redirection failures as fatal
Debugged-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/net/tcp/iscsi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c index 019a4c1..ec004e4 100644 --- a/src/net/tcp/iscsi.c +++ b/src/net/tcp/iscsi.c @@ -1710,6 +1710,7 @@ static int iscsi_vredirect ( struct iscsi_session *iscsi, int type, va_list args ) { va_list tmp; struct sockaddr *peer; + int rc; /* Intercept redirects to a LOCATION_SOCKET and record the IP * 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, va_end ( tmp ); } - return xfer_vreopen ( &iscsi->socket, type, args ); + /* Redirect to new location */ + if ( ( rc = xfer_vreopen ( &iscsi->socket, type, args ) ) != 0 ) + goto err; + + return 0; + + err: + iscsi_close ( iscsi, rc ); + return rc; } /** iSCSI socket interface operations */ |