diff options
author | Craig Gallek <kraig@google.com> | 2015-06-15 11:26:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-15 19:49:22 -0700 |
commit | 3fd22af808f4d7455ba91596d334438c7ee0f889 (patch) | |
tree | 96b0f9e9e4d067bae6d5068cc8a8d0617d2d408e /net/ipv4/inet_diag.c | |
parent | eb4cb008529ca08e0d8c0fa54e8f739520197a65 (diff) | |
download | linux-3fd22af808f4d7455ba91596d334438c7ee0f889.tar.bz2 |
sock_diag: specify info_size per inet protocol
Previously, there was no clear distinction between the inet protocols
that used struct tcp_info to report information and those that didn't.
This change adds a specific size attribute to the inet_diag_handler
struct which defines these interfaces. This will make dispatching
sock_diag get_info requests identical for all inet protocols in a
following patch.
Tested: ss -au
Tested: ss -at
Signed-off-by: Craig Gallek <kraig@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r-- | net/ipv4/inet_diag.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 4d32262c7502..b1f01174bf32 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -200,9 +200,9 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, } #undef EXPIRES_IN_MS - if (ext & (1 << (INET_DIAG_INFO - 1))) { + if ((ext & (1 << (INET_DIAG_INFO - 1))) && handler->idiag_info_size) { attr = nla_reserve(skb, INET_DIAG_INFO, - sizeof(struct tcp_info)); + handler->idiag_info_size); if (!attr) goto errout; |