return NULL;
}
- nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, NBD_OPT_STARTTLS);
+ if (nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK,
+ NBD_OPT_STARTTLS) < 0) {
+ return NULL;
+ }
tioc = qio_channel_tls_new_server(ioc,
client->tlscreds,
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
return -EIO;
}
- nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_TLS_REQD,
- clientflags);
+ ret = nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_TLS_REQD,
+ clientflags);
+ if (ret < 0) {
+ return ret;
+ }
break;
}
} else if (fixedNewstyle) {
}
if (client->tlscreds) {
TRACE("TLS already enabled");
- nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_INVALID,
- clientflags);
+ ret = nbd_negotiate_send_rep(client->ioc,
+ NBD_REP_ERR_INVALID,
+ clientflags);
} else {
TRACE("TLS not configured");
- nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_POLICY,
- clientflags);
+ ret = nbd_negotiate_send_rep(client->ioc,
+ NBD_REP_ERR_POLICY,
+ clientflags);
+ }
+ if (ret < 0) {
+ return ret;
}
break;
default:
if (nbd_negotiate_drop_sync(client->ioc, length) != length) {
return -EIO;
}
- nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_UNSUP,
- clientflags);
+ ret = nbd_negotiate_send_rep(client->ioc, NBD_REP_ERR_UNSUP,
+ clientflags);
+ if (ret < 0) {
+ return ret;
+ }
break;
}
} else {