version 1.1.1.2, 2014/06/15 16:31:38
|
version 1.1.1.3, 2016/11/02 09:57:01
|
Line 16
|
Line 16
|
|
|
#include "dnsmasq.h" |
#include "dnsmasq.h" |
|
|
#ifdef HAVE_IPSET | #if defined(HAVE_IPSET) && defined(HAVE_LINUX_NETWORK) |
|
|
#include <string.h> |
#include <string.h> |
#include <errno.h> |
#include <errno.h> |
Line 121 static int new_add_to_ipset(const char *setname, const
|
Line 121 static int new_add_to_ipset(const char *setname, const
|
struct my_nlattr *nested[2]; |
struct my_nlattr *nested[2]; |
uint8_t proto; |
uint8_t proto; |
int addrsz = INADDRSZ; |
int addrsz = INADDRSZ; |
ssize_t rc; |
|
|
|
#ifdef HAVE_IPV6 |
#ifdef HAVE_IPV6 |
if (af == AF_INET6) |
if (af == AF_INET6) |
Line 162 static int new_add_to_ipset(const char *setname, const
|
Line 161 static int new_add_to_ipset(const char *setname, const
|
nested[1]->nla_len = (void *)buffer + NL_ALIGN(nlh->nlmsg_len) - (void *)nested[1]; |
nested[1]->nla_len = (void *)buffer + NL_ALIGN(nlh->nlmsg_len) - (void *)nested[1]; |
nested[0]->nla_len = (void *)buffer + NL_ALIGN(nlh->nlmsg_len) - (void *)nested[0]; |
nested[0]->nla_len = (void *)buffer + NL_ALIGN(nlh->nlmsg_len) - (void *)nested[0]; |
|
|
while ((rc = sendto(ipset_sock, buffer, nlh->nlmsg_len, 0, | while (retry_send(sendto(ipset_sock, buffer, nlh->nlmsg_len, 0, |
(struct sockaddr *)&snl, sizeof(snl))) == -1 && retry_send()); | (struct sockaddr *)&snl, sizeof(snl)))); |
return rc; | |
| return errno == 0 ? 0 : -1; |
} |
} |
|
|
|
|