diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-03-19 16:58:24 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-03-19 16:58:24 +0300 |
commit | 3bb4fe7b2648d2814370aee5580c420e8cfb22ac (patch) | |
tree | 7dd7bbf2ad3164a3dc65c03e30403abd303eac5b | |
parent | 444385f2be198318d6092c049bbebf5cc981eeca (diff) | |
download | accel-ppp-3bb4fe7b2648d2814370aee5580c420e8cfb22ac.tar.gz accel-ppp-3bb4fe7b2648d2814370aee5580c420e8cfb22ac.zip |
libnetlink: export function iputils_get_handle()
-rw-r--r-- | accel-pppd/libnetlink/iputils.c | 8 | ||||
-rw-r--r-- | accel-pppd/libnetlink/iputils.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index 0100c52b..59483003 100644 --- a/accel-pppd/libnetlink/iputils.c +++ b/accel-pppd/libnetlink/iputils.c @@ -68,6 +68,14 @@ static void free_rth(void *arg) _free(rth); } +struct rtnl_handle __export *iputils_get_handle() +{ + if (!rth) + open_rth(); + + return rth; +} + static int store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) { struct ifinfomsg *ifi = NLMSG_DATA(n); diff --git a/accel-pppd/libnetlink/iputils.h b/accel-pppd/libnetlink/iputils.h index a623197f..cd3eb17f 100644 --- a/accel-pppd/libnetlink/iputils.h +++ b/accel-pppd/libnetlink/iputils.h @@ -27,4 +27,6 @@ int ip6addr_del(int ifindex, struct in6_addr *addr, int prefix_len); int iprule_add(uint32_t addr, int table); int iprule_del(uint32_t addr, int table); + +struct rtnl_handle *iputils_get_handle(); #endif |