summaryrefslogtreecommitdiffstats
path: root/ip/iproute.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@codefidence.com>2009-10-06 15:40:34 +0200
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-01 15:51:44 -0800
commit71e5815105fb0b86af7df9c719f7c106f05f29c0 (patch)
treea9127c680dadabbb3f70b8d2bffc09e479cbd094 /ip/iproute.c
parent232642c28c5320e6cf1e32f667f866c5f7372bfe (diff)
iproute2 add hoplimit parsing and update usage and documentation
- Parse and handle the hoplimit ip route option and add it to the usage line and documentation. - Add the missing reordering ip route option to the usage line. - Add documentation for initcwnd ip route option. Tested by setting hoplimit and retreiving it via "show". Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com> [ported to HEAD, fixed a bug with hoplimit lock handling, added documentation] Signed-off-by: Ori Finkelman <ori@comsleep.com> Signed-off-by: Yony Amit <yony@comsleep.com>
Diffstat (limited to 'ip/iproute.c')
-rw-r--r--ip/iproute.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/ip/iproute.c b/ip/iproute.c
index 82abbdac..b60926da 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -65,10 +65,10 @@ static void usage(void)
fprintf(stderr, "INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n");
fprintf(stderr, "NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS\n");
fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n");
- fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n");
+ fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ] [reordering NUMBER ]\n");
fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
- fprintf(stderr, " [ rto_min TIME ]\n");
+ fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] \n");
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n");
fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n");
@@ -763,6 +763,18 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (get_unsigned(&mtu, *argv, 0))
invarg("\"mtu\" value is invalid\n", *argv);
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu);
+#ifdef RTAX_HOPLIMIT
+ } else if (strcmp(*argv, "hoplimit") == 0) {
+ unsigned hoplimit;
+ NEXT_ARG();
+ if (strcmp(*argv, "lock") == 0) {
+ mxlock |= (1<<RTAX_HOPLIMIT);
+ NEXT_ARG();
+ }
+ if (get_unsigned(&hoplimit, *argv, 0))
+ invarg("\"hoplimit\" value is invalid\n", *argv);
+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit);
+#endif
#ifdef RTAX_ADVMSS
} else if (strcmp(*argv, "advmss") == 0) {
unsigned mss;