diff --git a/src/udprelay.c b/src/udprelay.c index 571eb2c3..8b1f7f28 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -460,9 +460,12 @@ create_server_socket(const char *host, const char *port) ERROR("[udp] setsockopt IP_TRANSPARENT"); exit(EXIT_FAILURE); } - if (setsockopt(server_sock, IPPROTO_IP, IP_RECVORIGDSTADDR, &opt, sizeof(opt))) { + if (setsockopt(server_sock, SOL_IP, IP_RECVORIGDSTADDR, &opt, sizeof(opt))) { FATAL("[udp] setsockopt IP_RECVORIGDSTADDR"); } + if (setsockopt(server_sock, SOL_IPV6, IPV6_RECVORIGDSTADDR, &opt, sizeof(opt))) { + FATAL("[udp] setsockopt IPV6_RECVORIGDSTADDR"); + } #endif s = bind(server_sock, rp->ai_addr, rp->ai_addrlen);