Commit 91921525 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

When specifying the accesspoint, allow the MAC to be in either dotted

or undotted notation.
parent 3bb1cbeb
......@@ -195,20 +195,28 @@ sub os_ifconfig_line($$$$$$$;$$)
return undef;
}
my $accesspoint = $settings->{"accesspoint"};
my $accesspointwdots;
if (libsetup::findiface($accesspoint) eq $iface) {
$iwcmd .= " mode Master";
}
else {
# Allow either dotted or undotted notation!
if ($accesspoint =~ /^(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})$/) {
$accesspoint = "$1:$2:$3:$4:$5:$6";
$iwcmd .= " mode Managed ap $accesspoint";
$accesspointwdots = "$1:$2:$3:$4:$5:$6";
}
elsif ($accesspoint =~
/^(\w{2}):(\w{2}):(\w{2}):(\w{2}):(\w{2}):(\w{2})$/) {
$accesspointwdots = $accesspoint;
$accesspoint = "${1}${2}${3}${4}${5}${6}";
}
else {
warn("*** WARNING: Bad accesspoint provided for $iface!\n");
warn("*** WARNING: Improper format for MAC ($accesspoint) ".
"provided for $iface!\n");
return undef;
}
if (libsetup::findiface($accesspoint) eq $iface) {
$iwcmd .= " mode Master";
}
else {
$iwcmd .= " mode Managed ap $accesspointwdots";
}
$uplines = sprintf($IFCONFIG, $iface, $inet, $mask) . "\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment