1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
diff -u /tmp/openvpn-2.0.7/init.c openvpn-2.0.7/init.c
--- openvpn-2.0.7/init.c 2006-11-08 13:33:02.043877584 +0000
+++ openvpn-2.0.7/init.c 2006-11-08 13:33:24.000000000 +0000
@@ -347,7 +347,8 @@
msg (M_FATAL|M_OPTERR,
"options --mktun or --rmtun should only be used together with --dev");
tuncfg (options->dev, options->dev_type, options->dev_node,
- options->tun_ipv6, options->persist_mode);
+ options->tun_ipv6, options->persist_mode,
+ &options->tuntap_options);
return true;
}
#endif
diff -u /tmp/openvpn-2.0.7/tun.c openvpn-2.0.7/tun.c
--- openvpn-2.0.7/tun.c 2006-11-08 13:33:02.037878496 +0000
+++ openvpn-2.0.7/tun.c 2006-11-08 13:34:20.000000000 +0000
@@ -1095,13 +1095,14 @@
#ifdef TUNSETPERSIST
void
-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode)
+tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode, const struct tuntap_options *options)
{
struct tuntap *tt;
ALLOC_OBJ (tt, struct tuntap);
clear_tuntap (tt);
tt->type = dev_type_enum (dev, dev_type);
+ tt->options = *options;
open_tun (dev, dev_type, dev_node, ipv6, tt);
if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0)
msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev);
diff -u /tmp/openvpn-2.0.7/tun.h openvpn-2.0.7/tun.h
--- openvpn-2.0.7/tun.h 2006-11-08 13:33:02.042877736 +0000
+++ openvpn-2.0.7/tun.h 2006-11-08 13:33:50.000000000 +0000
@@ -194,7 +194,7 @@
int read_tun (struct tuntap* tt, uint8_t *buf, int len);
void tuncfg (const char *dev, const char *dev_type, const char *dev_node,
- bool ipv6, int persist_mode);
+ bool ipv6, int persist_mode, const struct tuntap_options *options);
const char *guess_tuntap_dev (const char *dev,
const char *dev_type,
|