projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
assert
[oweals/gnunet.git]
/
src
/
vpn
/
gnunet-vpn-tun.c
diff --git
a/src/vpn/gnunet-vpn-tun.c
b/src/vpn/gnunet-vpn-tun.c
index e3854495ff1088f6a22688ca050a16c49afd5e5d..07def09c787c6356a75fb20768145866fca50e10 100644
(file)
--- a/
src/vpn/gnunet-vpn-tun.c
+++ b/
src/vpn/gnunet-vpn-tun.c
@@
-1,18
+1,6
@@
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-
-#include <linux/if.h>
+#include "platform.h"
#include <linux/if_tun.h>
#include <linux/if_tun.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
/**
* Creates a tun-interface called dev;
* dev is asumed to point to a char[IFNAMSIZ]
/**
* Creates a tun-interface called dev;
* dev is asumed to point to a char[IFNAMSIZ]
@@
-29,7
+17,7
@@
int init_tun(char *dev) {{{
int fd, err;
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
int fd, err;
if( (fd = open("/dev/net/tun", O_RDWR)) < 0 ) {
- fprintf(stderr, "opening /dev/net/tun: %
m\n"
);
+ fprintf(stderr, "opening /dev/net/tun: %
s\n", strerror(errno)
);
return -1;
}
return -1;
}
@@
-42,7
+30,7
@@
int init_tun(char *dev) {{{
if ((err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
close(fd);
if ((err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
close(fd);
- fprintf(stderr, "ioctl'ing /dev/net/tun: %
m\n"
);
+ fprintf(stderr, "ioctl'ing /dev/net/tun: %
s\n", strerror(errno)
);
return err;
}
return err;
}