aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-15 09:12:47 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-15 09:12:47 +0000
commit5780adb586042f02b10546f17d3cf1bb72d1e9d5 (patch)
tree2da569f05f7901eb9dfccb130aba0e886c2f7e15 /networking
parent2666679692a9685107f49d7efb09ddb9c61ffd43 (diff)
downloadbusybox-5780adb586042f02b10546f17d3cf1bb72d1e9d5.tar.gz
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')
-rw-r--r--networking/libiproute/iproute.c17
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)
char *d = NULL;
int gw_ok = 0;
int dst_ok = 0;
- //int nhs_ok = 0;
- //int scope_ok = 0;
- //int table_ok = 0;
int proto_ok = 0;
int type_ok = 0;
@@ -325,6 +322,20 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (rtnl_open(&rth, 0) < 0)
exit(1);
+ if (d) {
+ int idx;
+
+ ll_init_map(&rth);
+
+ if (d) {
+ if ((idx = ll_name_to_index(d)) == 0) {
+ fprintf(stderr, "Cannot find device \"%s\"\n", d);
+ return -1;
+ }
+ addattr32(&req.n, sizeof(req), RTA_OIF, idx);
+ }
+ }
+
if (mxrta->rta_len > RTA_LENGTH(0)) {
if (mxlock)
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock);