diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2004-04-21 03:00:02 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.davemloft.net> | 2004-04-21 03:00:02 -0700 |
| commit | 424be00c07439f26e2ff0cf9003e02abff2820b2 (patch) | |
| tree | f8cee17927d76b03181599d5060a8e7d185ce75b | |
| parent | 719c06b8d9c738a689a71a73f7f42f3113245c1d (diff) | |
[TCP]: Add sysctl to turn off matrics caching.
| -rw-r--r-- | include/linux/sysctl.h | 1 | ||||
| -rw-r--r-- | include/net/tcp.h | 1 | ||||
| -rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 9 | ||||
| -rw-r--r-- | net/ipv4/tcp_input.c | 4 |
4 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d63d07fe674f..f32c83568201 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -326,6 +326,7 @@ enum NET_IPV4_IPFRAG_SECRET_INTERVAL=94, NET_TCP_WESTWOOD=95, NET_IPV4_IGMP_MAX_MSF=96, + NET_TCP_NO_METRICS_SAVE=97, }; enum { diff --git a/include/net/tcp.h b/include/net/tcp.h index 865c85133169..268da91f64dd 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -583,6 +583,7 @@ extern int sysctl_tcp_tw_reuse; extern int sysctl_tcp_frto; extern int sysctl_tcp_low_latency; extern int sysctl_tcp_westwood; +extern int sysctl_tcp_nometrics_save; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index dcf636b5926d..db468d5fb33c 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -594,6 +594,14 @@ ctl_table ipv4_table[] = { .strategy = &sysctl_jiffies }, { + .ctl_name = NET_TCP_NO_METRICS_SAVE, + .procname = "tcp_no_metrics_save", + .data = &sysctl_tcp_nometrics_save, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { .ctl_name = NET_TCP_WESTWOOD, .procname = "tcp_westwood", .data = &sysctl_tcp_westwood, @@ -601,6 +609,7 @@ ctl_table ipv4_table[] = { .mode = 0644, .proc_handler = &proc_dointvec, }, + { .ctl_name = 0 } }; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 1b551ac6e06a..c0f55ad0e573 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -87,6 +87,7 @@ int sysctl_tcp_rfc1337; int sysctl_tcp_max_orphans = NR_FILE; int sysctl_tcp_frto; int sysctl_tcp_westwood; +int sysctl_tcp_nometrics_save; #define FLAG_DATA 0x01 /* Incoming frame contained data. */ #define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ @@ -518,6 +519,9 @@ void tcp_update_metrics(struct sock *sk) struct tcp_opt *tp = tcp_sk(sk); struct dst_entry *dst = __sk_dst_get(sk); + if (sysctl_tcp_nometrics_save) + return; + dst_confirm(dst); if (dst && (dst->flags&DST_HOST)) { |
