projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add cleanup hook for integration tests
[tinc]
/
src
/
bsd
/
device.c
diff --git
a/src/bsd/device.c
b/src/bsd/device.c
index
5a572ba
..
235f4ec
100644
(file)
--- a/
src/bsd/device.c
+++ b/
src/bsd/device.c
@@
-1,7
+1,7
@@
/*
device.c -- Interaction BSD tun/tap device
Copyright (C) 2001-2005 Ivo Timmermans,
/*
device.c -- Interaction BSD tun/tap device
Copyright (C) 2001-2005 Ivo Timmermans,
- 2001-20
17
Guus Sliepen <guus@tinc-vpn.org>
+ 2001-20
21
Guus Sliepen <guus@tinc-vpn.org>
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
This program is free software; you can redistribute it and/or modify
2009 Grzegorz Dymarek <gregd72002@googlemail.com>
This program is free software; you can redistribute it and/or modify
@@
-40,8
+40,13
@@
#include <net/if_utun.h>
#endif
#include <net/if_utun.h>
#endif
+#if defined(HAVE_FREEBSD) || defined(HAVE_DRAGONFLY)
+#define DEFAULT_TUN_DEVICE "/dev/tun" // Use the autoclone device
+#define DEFAULT_TAP_DEVICE "/dev/tap"
+#else
#define DEFAULT_TUN_DEVICE "/dev/tun0"
#define DEFAULT_TAP_DEVICE "/dev/tap0"
#define DEFAULT_TUN_DEVICE "/dev/tun0"
#define DEFAULT_TAP_DEVICE "/dev/tap0"
+#endif
typedef enum device_type {
DEVICE_TYPE_TUN,
typedef enum device_type {
DEVICE_TYPE_TUN,
@@
-298,10
+303,7
@@
static bool setup_device(void) {
struct ifreq ifr;
if(ioctl(device_fd, TAPGIFNAME, (void *)&ifr) == 0) {
struct ifreq ifr;
if(ioctl(device_fd, TAPGIFNAME, (void *)&ifr) == 0) {
- if(iface) {
- free(iface);
- }
-
+ free(iface);
iface = xstrdup(ifr.ifr_name);
}
}
iface = xstrdup(ifr.ifr_name);
}
}