diff options
-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); |