Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
cd4b8267
Commit
cd4b8267
authored
Sep 18, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wireless: only advertise supported modes; closes #377
parent
a0b1e854
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
2 deletions
+32
-2
interfaces.inc
src/etc/inc/interfaces.inc
+19
-0
guiconfig.inc
src/www/guiconfig.inc
+5
-2
interfaces.php
src/www/interfaces.php
+4
-0
interfaces_wireless_edit.php
src/www/interfaces_wireless_edit.php
+4
-0
No files found.
src/etc/inc/interfaces.inc
View file @
cd4b8267
...
...
@@ -440,6 +440,25 @@ function interface_qinq2_configure(&$qinq, $fd, $macaddr) {
return
$vlanif
;
}
function
interfaces_test_wireless_capability
(
$if
,
$cap
)
{
$caps
=
array
(
'hostap'
=>
'HOSTAP'
,
'adhoc'
=>
'IBSS'
);
if
(
!
isset
(
$caps
[
$cap
]))
{
return
false
;
}
exec
(
sprintf
(
'/sbin/ifconfig %s list caps'
,
escapeshellarg
(
$if
)),
$lines
);
foreach
(
$lines
as
$line
)
{
if
(
preg_match
(
"/^drivercaps=.*<.*
{
$caps
[
$cap
]
}
.*>$/"
,
$line
))
{
return
true
;
}
}
return
false
;
}
function
interfaces_create_wireless_clones
()
{
global
$config
;
...
...
src/www/guiconfig.inc
View file @
cd4b8267
...
...
@@ -147,8 +147,11 @@ $wkports = array(
69
=>
"TFTP"
,
5900
=>
"VNC"
);
$wlan_modes
=
array
(
"bss"
=>
"Infrastructure (BSS)"
,
"adhoc"
=>
"Ad-hoc (IBSS)"
,
"hostap"
=>
"Access Point"
);
$wlan_modes
=
array
(
'bss'
=>
'Infrastructure (BSS)'
,
'adhoc'
=>
'Ad-hoc (IBSS)'
,
'hostap'
=>
'Access Point'
);
function
do_input_validation
(
$postdata
,
$reqdfields
,
$reqdfieldsn
,
&
$input_errors
)
{
...
...
src/www/interfaces.php
View file @
cd4b8267
...
...
@@ -3304,8 +3304,12 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<td
class=
"vtable"
>
<select
name=
"mode"
class=
"selectpicker"
data-style=
"btn-default"
id=
"mode"
>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'bss'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"bss"
>
<?=
gettext
(
"Infrastructure (BSS)"
);
?>
</option>
<?php
if
(
interfaces_test_wireless_capability
(
get_real_interface
(
$wancfg
[
'if'
]),
'adhoc'
))
:
?>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'adhoc'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"adhoc"
>
<?=
gettext
(
"Ad-hoc (IBSS)"
);
?>
</option>
<?php
endif
;
?>
<?php
if
(
interfaces_test_wireless_capability
(
get_real_interface
(
$wancfg
[
'if'
]),
'hostap'
))
:
?>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'hostap'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"hostap"
>
<?=
gettext
(
"Access Point"
);
?>
</option>
<?php
endif
;
?>
</select>
</td>
</tr>
...
...
src/www/interfaces_wireless_edit.php
View file @
cd4b8267
...
...
@@ -182,8 +182,12 @@ include("head.inc");
<td
class=
"vtable"
>
<select
name=
"mode"
class=
"selectpicker"
>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'bss'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"bss"
>
<?=
gettext
(
"Infrastructure (BSS)"
);
?>
</option>
<?php
if
(
interfaces_test_wireless_capability
(
$pconfig
[
'cloneif'
],
'adhoc'
))
:
?>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'adhoc'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"adhoc"
>
<?=
gettext
(
"Ad-hoc (IBSS)"
);
?>
</option>
<?php
endif
;
?>
<?php
if
(
interfaces_test_wireless_capability
(
$pconfig
[
'cloneif'
],
'hostap'
))
:
?>
<option
<?php
if
(
$pconfig
[
'mode'
]
==
'hostap'
)
echo
"selected=
\"
selected
\"
"
;
?>
value=
"hostap"
>
<?=
gettext
(
"Access Point"
);
?>
</option>
<?php
endif
;
?>
</select></td>
</tr>
<tr>
...
...
Write
Preview
Markdown
is supported
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