/* vi: set sw=4 ts=4: */
/*
- * RTnetlink service routines.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
return rtnl_send(rth, (void*)&req, sizeof(req));
}
+//TODO: pass rth->fd instead of full rth?
int FAST_FUNC rtnl_send(struct rtnl_handle *rth, char *buf, int len)
{
struct sockaddr_nl nladdr;
struct iovec iov[2] = { { &nlh, sizeof(nlh) }, { req, len } };
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- iov, 2,
- NULL, 0,
+ iov, 2,
+ NULL, 0,
0
};
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- &iov, 1,
- NULL, 0,
+ &iov, 1,
+ NULL, 0,
0
};
char *buf = xmalloc(8*1024); /* avoid big stack buffer */
struct msghdr msg = {
(void*)&nladdr, sizeof(nladdr),
- &iov, 1,
- NULL, 0,
+ &iov, 1,
+ NULL, 0,
0
};
if (rta->rta_type <= max) {
tb[rta->rta_type] = rta;
}
- rta = RTA_NEXT(rta,len);
+ rta = RTA_NEXT(rta, len);
}
if (len) {
bb_error_msg("deficit %d, rta_len=%d!", len, rta->rta_len);