Browse Source

Allow to receive IPv6 address. #1368

pull/1428/head
Max Lv 7 years ago
parent
commit
2867252303
1 changed files with 4 additions and 1 deletions
  1. 5
      src/udprelay.c

5
src/udprelay.c

@ -460,9 +460,12 @@ create_server_socket(const char *host, const char *port)
ERROR("[udp] setsockopt IP_TRANSPARENT"); ERROR("[udp] setsockopt IP_TRANSPARENT");
exit(EXIT_FAILURE); 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"); FATAL("[udp] setsockopt IP_RECVORIGDSTADDR");
} }
if (setsockopt(server_sock, SOL_IPV6, IPV6_RECVORIGDSTADDR, &opt, sizeof(opt))) {
FATAL("[udp] setsockopt IPV6_RECVORIGDSTADDR");
}
#endif #endif
s = bind(server_sock, rp->ai_addr, rp->ai_addrlen); s = bind(server_sock, rp->ai_addr, rp->ai_addrlen);

Loading…
Cancel
Save