Fix reading port number

This commit is contained in:
Jeremy Lakeman 2012-12-04 15:53:32 +10:30
parent abd804dd0c
commit 10ce16e1f3
3 changed files with 2 additions and 4 deletions

2
log.c
View File

@ -397,7 +397,6 @@ ssize_t get_self_executable_path(char *buf, size_t len)
int log_backtrace(struct __sourceloc whence)
{
#if 0
open_logging();
char execpath[MAXPATHLEN];
if (get_self_executable_path(execpath, sizeof execpath) == -1)
@ -495,6 +494,5 @@ int log_backtrace(struct __sourceloc whence)
strbuf_append_exit_status(b, status);
logMessage(LOG_LEVEL_DEBUG, __NOWHERE__, "gdb %s", buf);
unlink(tempfile);
#endif
return 0;
}

View File

@ -284,7 +284,7 @@ int load_subscriber_address(struct subscriber *subscriber){
}
snprintf(buff, sizeof(buff), "%s.port", sid_hex);
addr.sin_port = confValueGetInt64Range(buff, PORT_DNA, 1, 65535);
addr.sin_port = htons(confValueGetInt64Range(buff, PORT_DNA, 1, 65535));
return overlay_send_probe(subscriber, addr, interface);
}

View File

@ -345,7 +345,7 @@ int overlay_send_probe(struct subscriber *peer, struct sockaddr_in addr, overlay
op_free(frame);
return -1;
}
DEBUGF("Queued probe packet on interface %s", interface->name);
DEBUGF("Queued probe packet on interface %s to %s", interface->name, inet_ntoa(addr.sin_addr));
return 0;
}