diff options
author | Bernhard Reutner-Fischer | 2008-10-07 17:00:58 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer | 2008-10-07 17:00:58 +0000 |
commit | 578de8644c46cd17667812f7e335bf9fefbca00d (patch) | |
tree | aaa904d5d406fcc645fff16f0def4bc52dd4ebf1 /networking | |
parent | 2239f819411ff7ba47e5d14a6411a10bcfd1ef97 (diff) | |
download | busybox-578de8644c46cd17667812f7e335bf9fefbca00d.zip busybox-578de8644c46cd17667812f7e335bf9fefbca00d.tar.gz |
- route metric support (Natanael Copa)
Adds about 75b
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/iproute.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index bdccad6..a7ec66c 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c @@ -291,7 +291,7 @@ static int iproute_modify(int cmd, unsigned flags, char **argv) { static const char keywords[] ALIGN1 = "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0") - "dev\0""oif\0""to\0"; + "dev\0""oif\0""to\0""metric\0"; enum { ARG_src, ARG_via, @@ -300,7 +300,8 @@ static int iproute_modify(int cmd, unsigned flags, char **argv) USE_FEATURE_IP_RULE(ARG_table,) ARG_dev, ARG_oif, - ARG_to + ARG_to, + ARG_metric, }; enum { gw_ok = 1 << 0, @@ -387,6 +388,12 @@ USE_FEATURE_IP_RULE(ARG_table,) } else if (arg == ARG_dev || arg == ARG_oif) { NEXT_ARG(); d = *argv; + } else if (arg == ARG_metric) { + uint32_t metric; + NEXT_ARG(); + if (get_u32(&metric, *argv, 0)) + invarg(*argv, "metric"); + addattr32(&req.n, sizeof(req), RTA_PRIORITY, metric); } else { int type; inet_prefix dst; |