Project

General

Profile

Actions

Bug #15772

open

Captive Portal zoneid conflict when creating a new zone

Added by Paul Kutzer 15 days ago. Updated 15 days ago.

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

0%

Estimated time:
Release Notes:
Default
Affected Plus Version:
24.03
Affected Architecture:
amd64

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 #1

Updated by Christopher Cope 15 days ago

  • Status changed from New to Confirmed

I am able to reproduce this on

24.08-DEVELOPMENT (amd64)
built on Thu Oct 10 12:09:00 UTC 2024
FreeBSD 15.0-CURRENT

Actions #2

Updated by Christopher Cope 15 days ago

  • Priority changed from High to Normal
Actions

Also available in: Atom PDF