Project

General

Profile

Actions

Bug #15772

closed

Captive Portal zones can fail to start due to ID conflict

Added by Paul Kutzer about 1 month ago. Updated 15 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Captive Portal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
24.11
Release Notes:
Default
Affected Version:
2.7.2
Affected Architecture:
All

Description

There seems to be a bug inside services_captiveportal.php which allows, under specific circumstances, the creation of multiple captive portal zones with the same zoneid.

Result:
The newly created captive portal zone does not start, and nginx logs "bind() to 0.0.0.0:80XX failed (48: Address already in use)".
Also, the previously existing captive portal zone with the same zoneid stops working until its configuration is re-applied (edit -> save).

How to reproduce:
- Create three captive portal zones. This results in the zoneids 2, 4, 6 to be created and saved inside the configuration in this order.
- Delete the second captive portal zone. This results in the zoneids 2, 6 being present inside the configuration in this order.
- Create one captive portal zone. This results in the zoneids 2, 6, 4 being present inside the configuration in this order.
- Create another captive portal zone. This triggers the bug and results in the zoneids 2, 6, 4, 6 being present inside the configuration in this order.

Reason:
The code inside /usr/local/www/services_captiveportal.php (lines 327-334) seems to require, that the captive portal zones inside the configuration are correctly ordered by their zoneids. If that's not the case, the zoneid conflict may occur once a new captive portal zone is created.

Actions

Also available in: Atom PDF