From fc38f3fd9ab074f8d5d80c661861b286cac0caee Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 24 Feb 2009 15:08:05 +0000 Subject: fixed some name resolution issues --- src/uanytun.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/uanytun.c') diff --git a/src/uanytun.c b/src/uanytun.c index 7ac7c44..d7873d8 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -418,14 +418,20 @@ int main(int argc, char* argv[]) exit(ret); } char* local_string = udp_get_local_end_string(&sock); - log_printf(NOTICE, "listening on: %s", local_string); - free(local_string); + if(local_string) { + log_printf(NOTICE, "listening on: %s", local_string); + free(local_string); + } + if(opt.remote_addr_) { - udp_set_remote(&sock, opt.remote_addr_, opt.remote_port_); - char* remote_string = udp_get_remote_end_string(&sock); - log_printf(NOTICE, "set remote end to: %s", remote_string); - free(remote_string); + if(!udp_set_remote(&sock, opt.remote_addr_, opt.remote_port_)) { + char* remote_string = udp_get_remote_end_string(&sock); + if(remote_string) { + log_printf(NOTICE, "set remote end to: %s", remote_string); + free(remote_string); + } + } } -- cgit v1.2.3