1
1

Fix a problem when getting snd_cwnd on FreeBSD.

On FreeBSD, unlike Linux (and NetBSD?) snd_cwnd is expressed in
octets instead of segments.  Hilarity ensued when we erroneously
multiplied by snd_mss and integer overflows occureed.

Possible fix for #465, #475, #338.  Testing from FreeBSD users
appreciated.
Этот коммит содержится в:
Bruce A. Mah 2017-04-22 07:56:31 -07:00
родитель 13ff67e582
Коммит b9478db947
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4984910A8CAAEE8A

Просмотреть файл

@ -135,7 +135,7 @@ get_snd_cwnd(struct iperf_interval_results *irp)
#if defined(linux) && defined(TCP_MD5SIG)
return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
#elif defined(__FreeBSD__) && __FreeBSD_version >= 600000
return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
return irp->tcpInfo.tcpi_snd_cwnd;
#elif defined(__NetBSD__) && defined(TCP_INFO)
return irp->tcpInfo.tcpi_snd_cwnd * irp->tcpInfo.tcpi_snd_mss;
#else