bug fixes to extended_file output

This commit is contained in:
Zakir Durumeric
2013-08-29 14:51:26 -04:00
parent a5eb3d0a8d
commit 672143e9ba
3 changed files with 48 additions and 34 deletions

View File

@ -144,7 +144,17 @@ static int get_socket(void)
static int get_dryrun_socket(void)
{
return socket(AF_INET, SOCK_STREAM, 0);
// we need a socket in order to gather details about the system
// such as source MAC address and IP address. However, because
// we don't want to require root access in order to run dryrun,
// we just create a TCP socket.
int sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock <= 0) {
log_fatal("send", "couldn't create socket. "
"Error: %s\n", strerror(errno));
}
return sock;
}
static inline ipaddr_n_t get_src_ip(ipaddr_n_t dst, int local_offset)