From d4e53a38bd2f8a20941a165d9eb95c43606068f6 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Fri, 8 May 2020 12:48:36 +0200 Subject: [PATCH] debug --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 7bc4e99..319b2a2 100644 --- a/main.c +++ b/main.c @@ -42,7 +42,8 @@ void getutmp( int pid, char user[], char host_ip[], char host_ipv6[], time_t * t sprintf(host_ip, "%s", utmp->ut_host); //got ip of origin if((utmp->ut_addr_v6[1] && utmp->ut_addr_v6[2] && utmp->ut_addr_v6[3]) == 0) { - ipv4 = (utmp->ut_addr_v6[0] & 0x00000000ff000000) >> 6; + ipv4 = (utmp->ut_addr_v6[0] & 0x00000000ff000000) ; + ipv4 >>= 6; sprintf( str, "%x.", ipv4); strcat(host_ip, str); ipv4 = (utmp->ut_addr_v6[0] & 0x0000000000ff0000) >> 4;