fff-web-ui: fix port selection for TWO_PORT devices

Support for devices with two ports was originally intended for built-in
swconfig switches with only two externally exposed ethernet ports.

With the switch from ath71xx to ath79, the only device which ever made
use of this uncommon configuration (CPE210-v1) now has to dedicated
interfaces exposed to Linux. Therefore, two-port support was modified to
support two distinct interfaces instead of swconfig switch
configuration, which also simplified support for a few other devices.

However, the Web UI has not been taken into account. Due to the way the
Web UI detected a two-port device, the already implemented port selector
is not shown.

Use the TWO_PORT variable introduced with the change mentioned above to
detect two-port devices instead.

Fixes: #257
Fixes: c22032e254 ("fff-network: support native two-port devices")

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
This commit is contained in:
Fabian Bläse 2022-07-20 13:22:30 +02:00
parent 9bc3690cbd
commit baca28ece3
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ format_port() {
</fieldset>
</td></tr>
<% fi %>
<% if grep -q "LAN0PORT" "/etc/network.$board_name" || grep -q "LAN1PORT" "/etc/network.$board_name" ; then %>
<% if grep -q "TWO_PORT" "/etc/network.$board_name" ; then %>
<%
# Device has two ports
. /etc/network.mode