summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-23 14:18:13 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-23 14:18:13 +0000
commit364cdcb626efa89061100efce7eb168155da9906 (patch)
tree57165429664bfacdebea904e51cc5eab9893104f /src/linux
parentadded string_list (diff)
added extended logging support
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/tun.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/linux/tun.c b/src/linux/tun.c
index 1faf49d..87cc815 100644
--- a/src/linux/tun.c
+++ b/src/linux/tun.c
@@ -64,7 +64,7 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
dev->fd_ = open(DEFAULT_DEVICE, O_RDWR);
if(dev->fd_ < 0) {
- log_printf(ERR, "can't open device file (%s): %m", DEFAULT_DEVICE);
+ log_printf(ERROR, "can't open device file (%s): %m", DEFAULT_DEVICE);
tun_close(dev);
return -1;
}
@@ -81,7 +81,7 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
dev->with_pi_ = 0;
}
else {
- log_printf(ERR, "unable to recognize type of device (tun or tap)");
+ log_printf(ERROR, "unable to recognize type of device (tun or tap)");
tun_close(dev);
return -1;
}
@@ -94,13 +94,13 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
} else if(!ioctl(dev->fd_, (('T' << 8) | 202), &ifr)) {
dev->actual_name_ = strdup(ifr.ifr_name);
} else {
- log_printf(ERR, "tun/tap device ioctl failed: %m");
+ log_printf(ERROR, "tun/tap device ioctl failed: %m");
tun_close(dev);
return -1;
}
if(!dev->actual_name_) {
- log_printf(ERR, "can't open device file: memory error");
+ log_printf(ERROR, "can't open device file: memory error");
tun_close(dev);
return -2;
}
@@ -192,13 +192,13 @@ void tun_do_ifconfig(tun_device_t* dev)
char* command = NULL;
asprintf(&command, "/sbin/ifconfig %s %s netmask %s mtu %d", dev->actual_name_, dev->net_addr_, dev->net_mask_, dev->mtu_);
if(!command) {
- log_printf(ERR, "Execution of ifconfig failed");
+ log_printf(ERROR, "Execution of ifconfig failed");
return;
}
int result = system(command);
if(result == -1)
- log_printf(ERR, "Execution of ifconfig failed");
+ log_printf(ERROR, "Execution of ifconfig failed");
else
log_printf(NOTICE, "ifconfig returned %d", WEXITSTATUS(result));