Add initrwnd to iproute2
Add initrwnd option parsing to iproute. This option uses the new rtnetlink init_rcvwnd to set the TCP initial receive window size advertised by passive and active TCP connections. Signed-off-by: Laurent Chavey <chavey@google.com>
This commit is contained in:
parent
f703129d34
commit
f5fd80039f
|
|
@ -1336,6 +1336,13 @@ peers are allowed to send to us.
|
||||||
MSS (``Maximal Segment Size'') for same connection. The default is
|
MSS (``Maximal Segment Size'') for same connection. The default is
|
||||||
zero, meaning to use the values specified in~\cite{RFC2414}.
|
zero, meaning to use the values specified in~\cite{RFC2414}.
|
||||||
|
|
||||||
|
+\item \verb|initrwnd NUMBER|
|
||||||
|
|
||||||
|
+--- [2.6.33+ only] Initial receive window size for connections to
|
||||||
|
+ this destination. The actual window size is this value multiplied
|
||||||
|
+ by the MSS (''Maximal Segment Size'') of the connection. The default
|
||||||
|
+ value is zero, meaning to use Slow Start value.
|
||||||
|
|
||||||
\item \verb|nexthop NEXTHOP|
|
\item \verb|nexthop NEXTHOP|
|
||||||
|
|
||||||
--- the nexthop of a multipath route. \verb|NEXTHOP| is a complex value
|
--- the nexthop of a multipath route. \verb|NEXTHOP| is a complex value
|
||||||
|
|
|
||||||
13
ip/iproute.c
13
ip/iproute.c
|
|
@ -46,6 +46,7 @@ static const char *mx_names[RTAX_MAX+1] = {
|
||||||
[RTAX_INITCWND] = "initcwnd",
|
[RTAX_INITCWND] = "initcwnd",
|
||||||
[RTAX_FEATURES] = "features",
|
[RTAX_FEATURES] = "features",
|
||||||
[RTAX_RTO_MIN] = "rto_min",
|
[RTAX_RTO_MIN] = "rto_min",
|
||||||
|
[RTAX_INITRWND] = "initrwnd",
|
||||||
};
|
};
|
||||||
static void usage(void) __attribute__((noreturn));
|
static void usage(void) __attribute__((noreturn));
|
||||||
|
|
||||||
|
|
@ -68,7 +69,7 @@ static void usage(void)
|
||||||
fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ] [reordering NUMBER ]\n");
|
fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ] [reordering NUMBER ]\n");
|
||||||
fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
|
fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
|
||||||
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
|
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
|
||||||
fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] \n");
|
fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]\n");
|
||||||
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
|
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
|
||||||
fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n");
|
fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n");
|
||||||
fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n");
|
fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n");
|
||||||
|
|
@ -844,6 +845,16 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
|
||||||
if (get_unsigned(&win, *argv, 0))
|
if (get_unsigned(&win, *argv, 0))
|
||||||
invarg("\"initcwnd\" value is invalid\n", *argv);
|
invarg("\"initcwnd\" value is invalid\n", *argv);
|
||||||
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, win);
|
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITCWND, win);
|
||||||
|
} else if (matches(*argv, "initrwnd") == 0) {
|
||||||
|
unsigned win;
|
||||||
|
NEXT_ARG();
|
||||||
|
if (strcmp(*argv, "lock") == 0) {
|
||||||
|
mxlock |= (1<<RTAX_INITRWND);
|
||||||
|
NEXT_ARG();
|
||||||
|
}
|
||||||
|
if (get_unsigned(&win, *argv, 0))
|
||||||
|
invarg("\"initrwnd\" value is invalid\n", *argv);
|
||||||
|
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_INITRWND, win);
|
||||||
} else if (matches(*argv, "rttvar") == 0) {
|
} else if (matches(*argv, "rttvar") == 0) {
|
||||||
unsigned win;
|
unsigned win;
|
||||||
NEXT_ARG();
|
NEXT_ARG();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue