diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-11-15 09:12:47 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-11-15 09:12:47 +0000 |
commit | 5780adb586042f02b10546f17d3cf1bb72d1e9d5 (patch) | |
tree | 2da569f05f7901eb9dfccb130aba0e886c2f7e15 /networking/libiproute | |
parent | 2666679692a9685107f49d7efb09ddb9c61ffd43 (diff) | |
download | busybox-w32-5780adb586042f02b10546f17d3cf1bb72d1e9d5.tar.gz busybox-w32-5780adb586042f02b10546f17d3cf1bb72d1e9d5.tar.bz2 busybox-w32-5780adb586042f02b10546f17d3cf1bb72d1e9d5.zip |
Patch from Bastian Blank:
hi erik
the following patch fixes the handling of iproute add <route> dev <dev>.
the code got lost while removing things.
bastian
Diffstat (limited to 'networking/libiproute')
-rw-r--r-- | networking/libiproute/iproute.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index e38abcd01..8b6e7eebd 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -234,9 +234,6 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) | |||
234 | char *d = NULL; | 234 | char *d = NULL; |
235 | int gw_ok = 0; | 235 | int gw_ok = 0; |
236 | int dst_ok = 0; | 236 | int dst_ok = 0; |
237 | //int nhs_ok = 0; | ||
238 | //int scope_ok = 0; | ||
239 | //int table_ok = 0; | ||
240 | int proto_ok = 0; | 237 | int proto_ok = 0; |
241 | int type_ok = 0; | 238 | int type_ok = 0; |
242 | 239 | ||
@@ -325,6 +322,20 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv) | |||
325 | if (rtnl_open(&rth, 0) < 0) | 322 | if (rtnl_open(&rth, 0) < 0) |
326 | exit(1); | 323 | exit(1); |
327 | 324 | ||
325 | if (d) { | ||
326 | int idx; | ||
327 | |||
328 | ll_init_map(&rth); | ||
329 | |||
330 | if (d) { | ||
331 | if ((idx = ll_name_to_index(d)) == 0) { | ||
332 | fprintf(stderr, "Cannot find device \"%s\"\n", d); | ||
333 | return -1; | ||
334 | } | ||
335 | addattr32(&req.n, sizeof(req), RTA_OIF, idx); | ||
336 | } | ||
337 | } | ||
338 | |||
328 | if (mxrta->rta_len > RTA_LENGTH(0)) { | 339 | if (mxrta->rta_len > RTA_LENGTH(0)) { |
329 | if (mxlock) | 340 | if (mxlock) |
330 | rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock); | 341 | rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock); |