diff options
Diffstat (limited to 'networking/libiproute/iprule.c')
-rw-r--r-- | networking/libiproute/iprule.c | 15 |
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; |