iproute: support onelink route option and print route flags
[oweals/busybox.git] / networking / libiproute / libnetlink.c
index 8da80b2fcc900034ce66df2f77d2efbf46f4b41c..c7533a4a706bcd5d4b1dcc59608cdd1eb34db6a1 100644 (file)
@@ -1,7 +1,5 @@
 /* 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
@@ -57,6 +55,7 @@ int FAST_FUNC xrtnl_wilddump_request(struct rtnl_handle *rth, int family, int ty
        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;
@@ -74,8 +73,8 @@ int FAST_FUNC rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, in
        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
        };
 
@@ -108,8 +107,8 @@ static int rtnl_dump_filter(struct rtnl_handle *rth,
 
                struct msghdr msg = {
                        (void*)&nladdr, sizeof(nladdr),
-                       &iov,   1,
-                       NULL,   0,
+                       &iov, 1,
+                       NULL, 0,
                        0
                };
 
@@ -214,8 +213,8 @@ int FAST_FUNC rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
        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
        };
 
@@ -394,7 +393,7 @@ void FAST_FUNC parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, in
                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);