aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iprule.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-04-12 11:34:39 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-04-12 11:34:39 +0000
commitb290889f0265e1278e8a868aa82a65bcc9099b0f (patch)
tree2fc8dcc3b7f525f61817417e32c2827b57e17b8a /networking/libiproute/iprule.c
parent51742f4bb0c57a4d5063ece9437a2f34a42e52c8 (diff)
downloadbusybox-w32-b290889f0265e1278e8a868aa82a65bcc9099b0f.tar.gz
busybox-w32-b290889f0265e1278e8a868aa82a65bcc9099b0f.tar.bz2
busybox-w32-b290889f0265e1278e8a868aa82a65bcc9099b0f.zip
- 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 d4cf2826c..0499a0994 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -175,16 +175,10 @@ static int iprule_list(int argc, char **argv)
175 return -1; 175 return -1;
176 } 176 }
177 177
178 if (rtnl_open(&rth, 0) < 0) 178 xrtnl_open(&rth);
179 return 1;
180 179
181 if (rtnl_wilddump_request(&rth, af, RTM_GETRULE) < 0) { 180 xrtnl_wilddump_request(&rth, af, RTM_GETRULE);
182 bb_perror_msg_and_die("cannot send dump request"); 181 xrtnl_dump_filter(&rth, print_rule, stdout);
183 }
184
185 if (rtnl_dump_filter(&rth, print_rule, stdout, NULL, NULL) < 0) {
186 bb_error_msg_and_die("dump terminated");
187 }
188 182
189 return 0; 183 return 0;
190} 184}
@@ -296,8 +290,7 @@ static int iprule_modify(int cmd, int argc, char **argv)
296 if (!table_ok && cmd == RTM_NEWRULE) 290 if (!table_ok && cmd == RTM_NEWRULE)
297 req.r.rtm_table = RT_TABLE_MAIN; 291 req.r.rtm_table = RT_TABLE_MAIN;
298 292
299 if (rtnl_open(&rth, 0) < 0) 293 xrtnl_open(&rth);
300 return 1;
301 294
302 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0) 295 if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
303 return 2; 296 return 2;