Initialize `addrlen' before using. This might be the reason for `getnameinfo' failing..