summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-11-29 16:36:45 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-11-29 16:36:45 +0300
commitb136f6215b47d5cfd92aa3b2c458b2f36993b7ee (patch)
tree12eb93c9ba361c914df4b8493bbeac8261688684
parent63fbf6ed3ccb0eba42aaf0e6b15217b3c18ac5cc (diff)
downloadaccel-ppp-b136f6215b47d5cfd92aa3b2c458b2f36993b7ee.tar.gz
accel-ppp-b136f6215b47d5cfd92aa3b2c458b2f36993b7ee.zip
fixed compilation
-rw-r--r--accel-pppd/libnetlink/iputils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c
index 7c70209b..0100c52b 100644
--- a/accel-pppd/libnetlink/iputils.c
+++ b/accel-pppd/libnetlink/iputils.c
@@ -357,8 +357,9 @@ int __export ipaddr_add_peer(int ifindex, in_addr_t addr, int mask, in_addr_t pe
struct ifaddrmsg i;
char buf[4096];
} req;
- struct rtnl_handle *rth = net->rtnl_get();
- int r = 0;
+
+ if (!rth)
+ open_rth();
if (!rth)
return -1;
@@ -376,11 +377,9 @@ int __export ipaddr_add_peer(int ifindex, in_addr_t addr, int mask, in_addr_t pe
addattr32(&req.n, sizeof(req), IFA_ADDRESS, peer_addr);
if (rtnl_talk(rth, &req.n, 0, 0, NULL, NULL, NULL, 0) < 0)
- r = -1;
-
- net->rtnl_put(rth);
+ return -1;
- return r;
+ return 0;
}
int __export ipaddr_del(int ifindex, in_addr_t addr, int mask)