Attached patch adding symbolic name support for captive-portal.

Option 114 for dhcpv4, 103 for dhcp6.

It should be possible to define it by option number.

But primary way at least Network Manager uses for detection of this is redirection of HTTP (unencrypted) request to some internal service. Typically it redirects all requests to custom hostname.

Cheers,
Petr

On 29/05/2017 13:12, Jorge Bastos wrote:
Howdy,

I think this is done by DHCP, and if not let me know it.

I want to put the some devices to open the browser to signin in my hotspot via captive portal. That is, when the devices connect to the WIFI network, the browser automatically open's, this on smartphones/tablet/similar (i've seen windows doing it aswell).

Is this done by an DHCP option, if yes any ideia on how to?

Thanks in advanced,
Jorge Bastos

--
Petr Menšík
Software Engineer, RHEL
Red Hat, https://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB

From 2c9c450a8213fabdabeee55bb51c88ac2d02db10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <[email protected]>
Date: Tue, 18 Nov 2025 22:23:12 +0100
Subject: [PATCH] Add captive-portal name support for DHCP options

Adds support into DHCP and DHCPv6 record. Useful for announcing URL for
captive portal API URI.

https://www.rfc-editor.org/rfc/rfc8910.html
---
 src/dhcp-common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dhcp-common.c b/src/dhcp-common.c
index d1d3eb02..95e2ad3c 100644
--- a/src/dhcp-common.c
+++ b/src/dhcp-common.c
@@ -709,7 +709,8 @@ static const struct opttab_t {
   { "client-machine-id", 97, 0 },
   { "posix-timezone", 100, OT_NAME }, /* RFC 4833, Sec. 2 */
   { "tzdb-timezone", 101, OT_NAME }, /* RFC 4833, Sec. 2 */
-  { "ipv6-only", 108, 4 | OT_DEC },  /* RFC 8925 */ 
+  { "ipv6-only", 108, 4 | OT_DEC },  /* RFC 8925 */
+  { "captive-portal", 114, OT_NAME },  /* RFC 8910 */
   { "subnet-select", 118, OT_INTERNAL },
   { "domain-search", 119, OT_RFC1035_NAME },
   { "sip-server", 120, 0 },
@@ -751,6 +752,7 @@ static const struct opttab_t opttab6[] = {
   { "ntp-server", 56, 0 /* OT_ADDR_LIST | OT_RFC1035_NAME */ },
   { "bootfile-url", 59, OT_NAME },
   { "bootfile-param", 60, OT_CSTRING },
+  { "captive-portal", 103, OT_NAME },  /* RFC 8910 */
   { NULL, 0, 0 }
 };
 #endif
-- 
2.51.1

_______________________________________________
Dnsmasq-discuss mailing list
[email protected]
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to