changed inet_ntop to inet_ntoa
commented out "free(ip)" not needed anymore