1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## hoplimit.dpatch by Andreas Henriksson <andreas@fatal.se>
3
## Original author unknown, split out from a direct source edit.
5
## All lines beginning with `## DP:' are a description of the patch.
6
## DP: Add implementation for hoplimit option.
9
diff -urNad pkg-iproute~/doc/ip-cref.tex pkg-iproute/doc/ip-cref.tex
10
--- pkg-iproute~/doc/ip-cref.tex 2008-01-09 21:32:40.000000000 +0100
11
+++ pkg-iproute/doc/ip-cref.tex 2008-01-09 21:34:21.000000000 +0100
12
@@ -1315,6 +1315,19 @@
13
If it is not given, Linux uses the value selected with \verb|sysctl|
14
variable \verb|net/ipv4/tcp_reordering|.
16
+\item \verb|hoplimit NUMBER|
18
+--- [2.5.74+ only] Hop limit on the path to this destination. If it is not
19
+ given, Linux uses the value selected with \verb|sysctl| variable
20
+ \verb|net/ipv4/ip_default_ttl|.
22
+\item \verb|initcwnd NUMBER|
24
+--- [2.5.70+ only] Initial congestion window size when establishing
25
+ connections to this destination. This value is multiplied with the
26
+ MSS (``Maximal Segment Size'') for the connection to get the actual
27
+ window size. If it is not given (or set to zero), Linux uses the
28
+ values specified in~\cite{RFC2414}.
31
\item \verb|nexthop NEXTHOP|
33
\bibitem{RFC-DHCP} R.~Droms.
34
``Dynamic Host Configuration Protocol.'', RFC-2131
36
+\bibitem{RFC2414} M.~Allman, S.~Floyd, C.~Partridge.
37
+``Increasing TCP's Initial Window'', RFC-2414.
42
diff -urNad pkg-iproute~/ip/iproute.c pkg-iproute/ip/iproute.c
43
--- pkg-iproute~/ip/iproute.c 2008-01-09 21:32:40.000000000 +0100
44
+++ pkg-iproute/ip/iproute.c 2008-01-09 21:34:21.000000000 +0100
46
fprintf(stderr, "INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n");
47
fprintf(stderr, "NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS\n");
48
fprintf(stderr, "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ]\n");
49
- fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n");
50
- fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
51
+ fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ] [ window NUMBER]\n");
52
+ fprintf(stderr, " [ cwnd NUMBER ] [ hoplimit NUMBER ] [ initcwnd NUMBER ]\n");
53
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
54
fprintf(stderr, " [ rto_min TIME ]\n");
55
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
57
invarg("\"reordering\" value is invalid\n", *argv);
58
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_REORDERING, reord);
61
+ } else if (matches(*argv, "hoplimit") == 0) {
64
+ if (strcmp(*argv, "lock") == 0) {
65
+ mxlock |= (1<<RTAX_HOPLIMIT);
68
+ if (get_unsigned(&hoplim, *argv, 0))
69
+ invarg("\"hoplimit\" value is invalid\n", *argv);
70
+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplim);
72
} else if (strcmp(*argv, "rtt") == 0) {