From e12fe2864a30f4e5b6c77fcf6128be7a6266d73e Mon Sep 17 00:00:00 2001 From: james Date: Thu, 13 Apr 2006 21:09:04 +0000 Subject: 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 --- init.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'init.c') 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) -- cgit