Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
91921525
Commit
91921525
authored
May 12, 2004
by
Leigh B. Stoller
Browse files
When specifying the accesspoint, allow the MAC to be in either dotted
or undotted notation.
parent
3bb1cbeb
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/linux/liblocsetup.pm
View file @
91921525
...
...
@@ -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
";
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment