diff options
Diffstat (limited to 'net/ipv4/tcp_metrics.c')
-rw-r--r-- | net/ipv4/tcp_metrics.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 2ab09cbae74d..06493736fbc8 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -663,10 +663,13 @@ void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | |||
663 | void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | 663 | void tcp_fastopen_cache_set(struct sock *sk, u16 mss, |
664 | struct tcp_fastopen_cookie *cookie, bool syn_lost) | 664 | struct tcp_fastopen_cookie *cookie, bool syn_lost) |
665 | { | 665 | { |
666 | struct dst_entry *dst = __sk_dst_get(sk); | ||
666 | struct tcp_metrics_block *tm; | 667 | struct tcp_metrics_block *tm; |
667 | 668 | ||
669 | if (!dst) | ||
670 | return; | ||
668 | rcu_read_lock(); | 671 | rcu_read_lock(); |
669 | tm = tcp_get_metrics(sk, __sk_dst_get(sk), true); | 672 | tm = tcp_get_metrics(sk, dst, true); |
670 | if (tm) { | 673 | if (tm) { |
671 | struct tcp_fastopen_metrics *tfom = &tm->tcpm_fastopen; | 674 | struct tcp_fastopen_metrics *tfom = &tm->tcpm_fastopen; |
672 | 675 | ||
@@ -988,7 +991,7 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
988 | return 0; | 991 | return 0; |
989 | } | 992 | } |
990 | 993 | ||
991 | static struct genl_ops tcp_metrics_nl_ops[] = { | 994 | static const struct genl_ops tcp_metrics_nl_ops[] = { |
992 | { | 995 | { |
993 | .cmd = TCP_METRICS_CMD_GET, | 996 | .cmd = TCP_METRICS_CMD_GET, |
994 | .doit = tcp_metrics_nl_cmd_get, | 997 | .doit = tcp_metrics_nl_cmd_get, |
@@ -1079,8 +1082,7 @@ void __init tcp_metrics_init(void) | |||
1079 | if (ret < 0) | 1082 | if (ret < 0) |
1080 | goto cleanup; | 1083 | goto cleanup; |
1081 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, | 1084 | ret = genl_register_family_with_ops(&tcp_metrics_nl_family, |
1082 | tcp_metrics_nl_ops, | 1085 | tcp_metrics_nl_ops); |
1083 | ARRAY_SIZE(tcp_metrics_nl_ops)); | ||
1084 | if (ret < 0) | 1086 | if (ret < 0) |
1085 | goto cleanup_subsys; | 1087 | goto cleanup_subsys; |
1086 | return; | 1088 | return; |