summaryrefslogtreecommitdiff
path: root/accel-pppd/libnetlink/ipset.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/libnetlink/ipset.c')
-rw-r--r--accel-pppd/libnetlink/ipset.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/accel-pppd/libnetlink/ipset.c b/accel-pppd/libnetlink/ipset.c
index 73125352..7834b644 100644
--- a/accel-pppd/libnetlink/ipset.c
+++ b/accel-pppd/libnetlink/ipset.c
@@ -41,7 +41,7 @@ static int __ipset_cmd(const char *name, in_addr_t addr, int cmd, int flags)
log_error("ipset: cannot open rtnetlink\n");
return -1;
}
-
+
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct nfgenmsg));
@@ -53,18 +53,18 @@ static int __ipset_cmd(const char *name, in_addr_t addr, int cmd, int flags)
addattr_l(&req.n, 4096, IPSET_ATTR_PROTOCOL, &protocol, 1);
addattr_l(&req.n, 4096, IPSET_ATTR_SETNAME, name, strlen(name) + 1);
-
+
tail1 = addattr_nest(&req.n, MAX_MSG, IPSET_ATTR_DATA | NLA_F_NESTED);
tail2 = addattr_nest(&req.n, MAX_MSG, IPSET_ATTR_IP | NLA_F_NESTED);
addattr32(&req.n, 4096, IPSET_ATTR_IPADDR_IPV4 | NLA_F_NET_BYTEORDER, addr);
addattr_nest_end(&req.n, tail2);
-
+
addattr_nest_end(&req.n, tail1);
-
+
if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL, 0) < 0)
goto out_err;
-
+
rtnl_close(&rth);
return 0;
@@ -100,7 +100,7 @@ int __export ipset_flush(const char *name)
log_error("ipset: cannot open rtnetlink\n");
return -1;
}
-
+
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct nfgenmsg));
@@ -112,10 +112,10 @@ int __export ipset_flush(const char *name)
addattr_l(&req.n, 4096, IPSET_ATTR_PROTOCOL, &protocol, 1);
addattr_l(&req.n, 4096, IPSET_ATTR_SETNAME, name, strlen(name) + 1);
-
+
if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL, 0) < 0)
goto out_err;
-
+
rtnl_close(&rth);
return 0;