Second os detection try

This commit is contained in:
2020-08-13 12:15:51 +02:00
parent 53e20b0e72
commit 3b127cffa8

View File

@ -106,10 +106,10 @@ string get_os_info(int fd) {
struct tcp_info ti;
socklen_t tisize = sizeof(ti);
getsockopt(fd, IPPROTO_TCP, TCP_INFO, &ti, &tisize);
int winsize = ti.tcpi_rcv_wscale;
int winsize = ti.tcpi_rcv_space;
int ttl;
socklen_t ttlsize = sizeof(ttl);
unsigned int ttlsize = sizeof(ttl);
getsockopt(fd, IPPROTO_TCP, IP_TTL, &ttl, &ttlsize);
return "win_size=" + to_string(winsize) + ", ttl=" + to_string(ttl);