From: Christian Brauner Date: Fri, 25 Aug 2017 05:07:43 +0000 (+0200) Subject: rtnl: non-functional changes X-Git-Tag: lxc-1.0.11~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9de45f8f1cbb0bf34080b7b093ad412c416c38f6;p=thirdparty%2Flxc.git rtnl: non-functional changes Signed-off-by: Christian Brauner --- diff --git a/src/lxc/rtnl.c b/src/lxc/rtnl.c index 186c788a0..dd8f095f1 100644 --- a/src/lxc/rtnl.c +++ b/src/lxc/rtnl.c @@ -54,20 +54,24 @@ extern int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg) } extern int rtnetlink_transaction(struct rtnl_handler *handler, - struct rtnlmsg *request, struct rtnlmsg *answer) + struct rtnlmsg *request, + struct rtnlmsg *answer) { - return netlink_transaction(&handler->nlh, (struct nlmsg *)&request->nlmsghdr, + return netlink_transaction(&handler->nlh, + (struct nlmsg *)&request->nlmsghdr, (struct nlmsg *)&answer->nlmsghdr); } extern struct rtnlmsg *rtnlmsg_alloc(size_t size) { -/* size_t len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size; */ -/* return (struct rtnlmsg *)nlmsg_alloc(len); */ + /* + size_t len; + + len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size; + return (struct rtnlmsg *)nlmsg_alloc(len); + */ + return NULL; } -extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg) -{ - free(rtnlmsg); -} +extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg) { free(rtnlmsg); } diff --git a/src/lxc/rtnl.h b/src/lxc/rtnl.h index d9ad45d71..5d6e5a852 100644 --- a/src/lxc/rtnl.h +++ b/src/lxc/rtnl.h @@ -20,6 +20,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + #ifndef __LXC_RTNL_H #define __LXC_RTNL_H @@ -35,8 +36,7 @@ * * @nlh: the netlink socket handler */ -struct rtnl_handler -{ +struct rtnl_handler { struct nl_handler nlh; }; @@ -59,7 +59,7 @@ struct rtnlmsg { * * Returns 0 on success, < 0 otherwise */ -int rtnetlink_open(struct rtnl_handler *handler); +extern int rtnetlink_open(struct rtnl_handler *handler); /* * genetlink_close : close a route netlink socket @@ -68,7 +68,7 @@ int rtnetlink_open(struct rtnl_handler *handler); * * Returns 0 on success, < 0 otherwise */ -int rtnetlink_close(struct rtnl_handler *handler); +extern int rtnetlink_close(struct rtnl_handler *handler); /* * rtnetlink_rcv : receive a route netlink socket, it is up @@ -79,7 +79,7 @@ int rtnetlink_close(struct rtnl_handler *handler); * * Returns 0 on success, < 0 otherwise */ -int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); +extern int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); /* * rtnetlink_send : send a route netlink socket, it is up @@ -90,11 +90,12 @@ int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); * * Returns 0 on success, < 0 otherwise */ -int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg); +extern int rtnetlink_send(struct rtnl_handler *handler, + struct rtnlmsg *rtnlmsg); struct genlmsg *genlmsg_alloc(size_t size); -void rtnlmsg_free(struct rtnlmsg *rtnlmsg); +extern void rtnlmsg_free(struct rtnlmsg *rtnlmsg); /* * rtnetlink_transaction : send and receive a route netlink message in one shot @@ -105,6 +106,8 @@ void rtnlmsg_free(struct rtnlmsg *rtnlmsg); * * Returns 0 on success, < 0 otherwise */ -int rtnetlink_transaction(struct rtnl_handler *handler, - struct rtnlmsg *request, struct rtnlmsg *answer); -#endif +extern int rtnetlink_transaction(struct rtnl_handler *handler, + struct rtnlmsg *request, + struct rtnlmsg *answer); + +#endif /* __LXC_RTNL_H */