+ inet_aton(td->o.filename, &sin.sin_addr);
+
+ mr.imr_multiaddr = sin.sin_addr;
+ if (o->intfc) {
+ if (inet_aton(o->intfc, &mr.imr_interface) == 0) {
+ log_err("fio: interface not valid interface IP\n");
+ close(fd);
+ return 1;
+ }
+ } 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);
+ return 1;
+ }
+ }
+
+ if (!is_ipv6(o)) {
+ saddr = (struct sockaddr *) &nd->addr;
+ len = sizeof(nd->addr);
+
+ nd->addr.sin_family = AF_INET;
+ nd->addr.sin_addr.s_addr = sin.sin_addr.s_addr ? sin.sin_addr.s_addr : htonl(INADDR_ANY);
+ nd->addr.sin_port = htons(port);
+ } else {
+ saddr = (struct sockaddr *) &nd->addr6;
+ len = sizeof(nd->addr6);
+
+ nd->addr6.sin6_family = AF_INET6;
+ nd->addr6.sin6_addr = sin6.sin6_addr.s6_addr ? sin6.sin6_addr : in6addr_any;
+ nd->addr6.sin6_port = htons(port);
+ }
+
+ if (bind(fd, saddr, len) < 0) {