diff --git a/common.c b/common.c index 2eebda2..9ea1516 100644 --- a/common.c +++ b/common.c @@ -269,7 +269,7 @@ int bind_peer(int fd, int fd_from) return 0; #ifndef IP_BINDANY /* use IP_TRANSPARENT */ - res = setsockopt(fd, SOL_IP, IP_TRANSPARENT, &enable, sizeof(enable)); + res = setsockopt(fd, IPPROTO_IP, IP_TRANSPARENT, &enable, sizeof(enable)); CHECK_RES_DIE(res, "setsockopt IP_TRANSPARENT"); res = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)); CHECK_RES_DIE(res, "setsockopt SO_REUSEADDR"); @@ -293,7 +293,7 @@ int bind_peer(int fd, int fd_from) } res = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &disable, sizeof(disable)); CHECK_RES_DIE(res, "setsockopt SO_REUSEADDR"); - res = setsockopt(fd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &enable, sizeof(enable)); + res = setsockopt(fd, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, &enable, sizeof(enable)); CHECK_RES_RETURN(res, "setsockopt IP_BIND_ADDRESS_NO_PORT", res); ((struct sockaddr_in *)from.ai_addr)->sin_port = 0; res = bind(fd, from.ai_addr, from.ai_addrlen);