From 6611e9c767bad5c903c8ac59b9ae8409315dbca2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 24 Jan 2014 07:36:43 -0800 Subject: [PATCH] engine: more checks on IPv6 and multicast Signed-off-by: Jens Axboe --- engines/net.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/net.c b/engines/net.c index 5fdc88ce..4be106a2 100644 --- a/engines/net.c +++ b/engines/net.c @@ -1039,12 +1039,17 @@ static int fio_netio_setup_listen_inet(struct thread_data *td, short port) } #endif - if (td->o.filename){ + if (td->o.filename) { if (!is_udp(o) || !fio_netio_is_multicast(td->o.filename)) { log_err("fio: hostname not valid for non-multicast inbound network IO\n"); close(fd); return 1; } + if (is_ipv6(o)) { + log_err("fio: IPv6 not supported for multicast network IO"); + close(fd); + return 1; + } inet_aton(td->o.filename, &sin.sin_addr); @@ -1058,6 +1063,7 @@ static int fio_netio_setup_listen_inet(struct thread_data *td, short port) } else { mr.imr_interface.s_addr = htonl(INADDR_ANY); } + if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (const char*)&mr, sizeof(mr)) < 0) { td_verror(td, errno, "setsockopt IP_ADD_MEMBERSHIP"); close(fd); -- 2.25.1