summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 21:09:04 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-13 21:09:04 +0000
commite12fe2864a30f4e5b6c77fcf6128be7a6266d73e (patch)
tree2b2e445fb562542bd9c3c0e0e8eabb05e4145539 /init.c
parent40ac3d7ac1cb29bf5d482e162c102c56a5e2e5e6 (diff)
downloadopenvpn-e12fe2864a30f4e5b6c77fcf6128be7a6266d73e.tar.gz
openvpn-e12fe2864a30f4e5b6c77fcf6128be7a6266d73e.tar.xz
openvpn-e12fe2864a30f4e5b6c77fcf6128be7a6266d73e.zip
Added --lladdr option to specify the link layer (MAC) address
for the tap interface on non-Windows platforms (Roy Marples). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1012 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'init.c')
-rw-r--r--init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/init.c b/init.c
index 0bc5219..d23272c 100644
--- a/init.c
+++ b/init.c
@@ -40,6 +40,7 @@
#include "gremlin.h"
#include "pkcs11.h"
#include "ps.h"
+#include "lladdr.h"
#include "memdbg.h"
@@ -425,6 +426,8 @@ do_persist_tuntap (const struct options *options)
"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);
+ if (options->persist_mode && options->lladdr)
+ set_lladdr(options->dev, options->lladdr, NULL);
return true;
}
#endif
@@ -836,6 +839,10 @@ do_open_tun (struct context *c)
open_tun (c->options.dev, c->options.dev_type, c->options.dev_node,
c->options.tun_ipv6, c->c1.tuntap);
+ /* set the hardware address */
+ if (c->options.lladdr)
+ set_lladdr(c->c1.tuntap->actual_name, c->options.lladdr, c->c2.es);
+
/* do ifconfig */
if (!c->options.ifconfig_noexec
&& ifconfig_order () == IFCONFIG_AFTER_TUN_OPEN)