summaryrefslogtreecommitdiff
path: root/networking/libiproute/iprule.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-04-12 11:34:39 +0000
committerBernhard Reutner-Fischer2007-04-12 11:34:39 +0000
commitb290889f0265e1278e8a868aa82a65bcc9099b0f (patch)
tree2fc8dcc3b7f525f61817417e32c2827b57e17b8a /networking/libiproute/iprule.c
parent51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (diff)
downloadbusybox-b290889f0265e1278e8a868aa82a65bcc9099b0f.zip
busybox-b290889f0265e1278e8a868aa82a65bcc9099b0f.tar.gz
- add xsendto and use where appropriate; shrink iplink; sanitize libiproute a bit.
-916 byte
Diffstat (limited to 'networking/libiproute/iprule.c')
-rw-r--r--networking/libiproute/iprule.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index d4cf282..0499a09 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -175,16 +175,10 @@ static int iprule_list(int argc, char **argv)
return -1;
}
- if (rtnl_open(&rth, 0) < 0)
- return 1;
+ xrtnl_open(&rth);
- if (rtnl_wilddump_request(&rth, af, RTM_GETRULE) < 0) {
- bb_perror_msg_and_die("cannot send dump request");
- }
-
- if (rtnl_dump_filter(&rth, print_rule, stdout, NULL, NULL) < 0) {
- bb_error_msg_and_die("dump terminated");
- }
+ xrtnl_wilddump_request(&rth, af, RTM_GETRULE);
+ xrtnl_dump_filter(&rth, print_rule, stdout);
return 0;
}
@@ -296,8 +290,7 @@ static int iprule_modify(int cmd, int argc, char **argv)
if (!table_ok && cmd == RTM_NEWRULE)
req.r.rtm_table = RT_TABLE_MAIN;
- if (rtnl_open(&rth, 0) < 0)
- return 1;
+ xrtnl_open(&rth);
if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
return 2;