diff options
author | Andrei Vagin <avagin@virtuozzo.com> | 2017-09-30 01:41:42 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@virtuozzo.com> | 2017-10-17 08:40:44 +0300 |
commit | 598790eb4396769eeedc36c9b92d617a9cca80ef (patch) | |
tree | 974bff9f43303ed7ff30ad0cc6dc7c748ef45d8f /soccr | |
parent | 7178717bcf019aee7b24b677e412b72aa1749708 (diff) |
tcp: be ready that a size of tcp_info can be changed
(00.052683) Error (soccr/soccr.c:166): Failed to obtain TCP_INFO: No error information
We don't need a whole tcp info, so get only a part
what we are going to use.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'soccr')
-rw-r--r-- | soccr/soccr.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/soccr/soccr.c b/soccr/soccr.c index 48469aaab..1a1aaa35d 100644 --- a/soccr/soccr.c +++ b/soccr/soccr.c @@ -157,7 +157,18 @@ void libsoccr_release(struct libsoccr_sk *sk) free(sk); } -static int refresh_sk(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, struct tcp_info *ti) +struct soccr_tcp_info { + __u8 tcpi_state; + __u8 tcpi_ca_state; + __u8 tcpi_retransmits; + __u8 tcpi_probes; + __u8 tcpi_backoff; + __u8 tcpi_options; + __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; +}; + +static int refresh_sk(struct libsoccr_sk *sk, + struct libsoccr_sk_data *data, struct soccr_tcp_info *ti) { int size; socklen_t olen = sizeof(*ti); @@ -215,7 +226,8 @@ static int refresh_sk(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, str return 0; } -static int get_stream_options(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, struct tcp_info *ti) +static int get_stream_options(struct libsoccr_sk *sk, + struct libsoccr_sk_data *data, struct soccr_tcp_info *ti) { int ret; socklen_t auxl; @@ -353,7 +365,7 @@ err_recv: int libsoccr_save(struct libsoccr_sk *sk, struct libsoccr_sk_data *data, unsigned data_size) { - struct tcp_info ti; + struct soccr_tcp_info ti; if (!data || data_size < SOCR_DATA_MIN_SIZE) { loge("Invalid input parameters\n"); |