aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-07 17:00:58 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-07 17:00:58 +0000
commit578de8644c46cd17667812f7e335bf9fefbca00d (patch)
treeaaa904d5d406fcc645fff16f0def4bc52dd4ebf1
parent2239f819411ff7ba47e5d14a6411a10bcfd1ef97 (diff)
downloadbusybox-w32-578de8644c46cd17667812f7e335bf9fefbca00d.tar.gz
busybox-w32-578de8644c46cd17667812f7e335bf9fefbca00d.tar.bz2
busybox-w32-578de8644c46cd17667812f7e335bf9fefbca00d.zip
- route metric support (Natanael Copa)
Adds about 75b
-rw-r--r--include/usage.h3
-rw-r--r--networking/libiproute/iproute.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/include/usage.h b/include/usage.h
index fa7ac3bf7..8f6013ede 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1992,7 +1992,8 @@
1992 " [oif STRING] [tos TOS]\n" \ 1992 " [oif STRING] [tos TOS]\n" \
1993 "iproute { add | del | change | append | replace | monitor } ROUTE\n" \ 1993 "iproute { add | del | change | append | replace | monitor } ROUTE\n" \
1994 " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \ 1994 " SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
1995 " ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]" \ 1995 " ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" \
1996 " [metric METRIC]" \
1996 1997
1997#define iprule_trivial_usage \ 1998#define iprule_trivial_usage \
1998 "{[list | add | del] RULE}" 1999 "{[list | add | del] RULE}"
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index bdccad69d..a7ec66c7f 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)
291{ 291{
292 static const char keywords[] ALIGN1 = 292 static const char keywords[] ALIGN1 =
293 "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0") 293 "src\0""via\0""mtu\0""lock\0""protocol\0"USE_FEATURE_IP_RULE("table\0")
294 "dev\0""oif\0""to\0"; 294 "dev\0""oif\0""to\0""metric\0";
295 enum { 295 enum {
296 ARG_src, 296 ARG_src,
297 ARG_via, 297 ARG_via,
@@ -300,7 +300,8 @@ static int iproute_modify(int cmd, unsigned flags, char **argv)
300USE_FEATURE_IP_RULE(ARG_table,) 300USE_FEATURE_IP_RULE(ARG_table,)
301 ARG_dev, 301 ARG_dev,
302 ARG_oif, 302 ARG_oif,
303 ARG_to 303 ARG_to,
304 ARG_metric,
304 }; 305 };
305 enum { 306 enum {
306 gw_ok = 1 << 0, 307 gw_ok = 1 << 0,
@@ -387,6 +388,12 @@ USE_FEATURE_IP_RULE(ARG_table,)
387 } else if (arg == ARG_dev || arg == ARG_oif) { 388 } else if (arg == ARG_dev || arg == ARG_oif) {
388 NEXT_ARG(); 389 NEXT_ARG();
389 d = *argv; 390 d = *argv;
391 } else if (arg == ARG_metric) {
392 uint32_t metric;
393 NEXT_ARG();
394 if (get_u32(&metric, *argv, 0))
395 invarg(*argv, "metric");
396 addattr32(&req.n, sizeof(req), RTA_PRIORITY, metric);
390 } else { 397 } else {
391 int type; 398 int type;
392 inet_prefix dst; 399 inet_prefix dst;