aboutsummaryrefslogtreecommitdiff
path: root/options.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 /options.c
parentAdded --route-metric option to set a default route metric (diff)
downloadopenvpn-e12fe2864a30f4e5b6c77fcf6128be7a6266d73e.tar.xz
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 'options.c')
-rw-r--r--options.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/options.c b/options.c
index effe1b1..8dcc645 100644
--- a/options.c
+++ b/options.c
@@ -147,6 +147,7 @@ static const char usage_message[] =
" does not begin with \"tun\" or \"tap\".\n"
"--dev-node node : Explicitly set the device node rather than using\n"
" /dev/net/tun, /dev/tun, /dev/tap, etc.\n"
+ "--lladdr hw : Set the link layer address of the tap device.\n"
"--topology t : Set --dev tun topology: 'net30', 'p2p', or 'subnet'.\n"
"--tun-ipv6 : Build tun link capable of forwarding IPv6 traffic.\n"
"--ifconfig l rn : TUN: configure device to use IP address l as a local\n"
@@ -1070,6 +1071,7 @@ show_settings (const struct options *o)
SHOW_STR (dev);
SHOW_STR (dev_type);
SHOW_STR (dev_node);
+ SHOW_STR (lladdr);
SHOW_INT (topology);
SHOW_BOOL (tun_ipv6);
SHOW_STR (ifconfig_local);
@@ -1403,6 +1405,10 @@ options_postprocess (struct options *options, bool first_time)
if (options->inetd == INETD_NOWAIT && dev != DEV_TYPE_TAP)
msg (M_USAGE, "--inetd nowait only makes sense in --dev tap mode");
+
+ if (options->lladdr && dev != DEV_TYPE_TAP)
+ msg (M_USAGE, "--lladdr can only be used in --dev tap mode");
+
/*
* In forking TCP server mode, you don't need to ifconfig
* the tap device (the assumption is that it will be bridged).
@@ -3217,6 +3223,11 @@ add_option (struct options *options,
VERIFY_PERMISSION (OPT_P_GENERAL);
options->dev_node = p[1];
}
+ else if (streq (p[0], "lladdr") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ options->lladdr = p[1];
+ }
else if (streq (p[0], "topology") && p[1])
{
VERIFY_PERMISSION (OPT_P_UP);