Commit 91921525 authored by Leigh Stoller's avatar Leigh Stoller

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;
# Allow either dotted or undotted notation!
if ($accesspoint =~ /^(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})$/) {
$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: Improper format for MAC ($accesspoint) ".
"provided for $iface!\n");
return undef;
}
if (libsetup::findiface($accesspoint) eq $iface) {
$iwcmd .= " mode Master";
}
else {
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";
}
else {
warn("*** WARNING: Bad accesspoint provided for $iface!\n");
return undef;
}
$iwcmd .= " mode Managed ap $accesspointwdots";
}
$uplines = sprintf($IFCONFIG, $iface, $inet, $mask) . "\n";
......
Markdown is supported
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