- ret->fwmark = se->fwmark;
- ret->protocol = se->protocol;
- ret->addr = se->addr;
- ret->port = se->port;
- ret->num_dests = se->num_dests;
-
- if (0 !=
- getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_DESTS, (void *)ret, &len)) {
- char errbuf[1024];
- log_err("ipvs_get_dests: getsockopt() failed: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
- free(ret);
+ dests->fwmark = se->fwmark;
+ dests->protocol = se->protocol;
+ dests->addr = se->addr;
+ dests->port = se->port;
+ dests->num_dests = se->num_dests;
+
+ if (getsockopt(sockfd, IPPROTO_IP, IP_VS_SO_GET_DESTS, dests, &len) == -1) {
+ log_err("ipvs_get_dests: getsockopt() failed: %s", STRERRNO);
+ free(dests);