net: fix segfault with receiver, tcp, and no hostname set
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/engines/net.c b/engines/net.c
index c533799..101f754 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -543,6 +543,15 @@
{
struct netio_data *nd = td->io_ops->data;
+ if (!host) {
+ log_err("fio: connect with no host to connect to.\n");
+ if (td_read(td))
+ log_err("fio: did you forget to set 'listen'?\n");
+
+ td_verror(td, EINVAL, "no hostname= set");
+ return 1;
+ }
+
nd->addr.sin_family = AF_INET;
nd->addr.sin_port = htons(port);