Page MenuHomeFreeBSD

rtsold: add Captive Portal (RFC 8910) support
Needs ReviewPublic

Authored by bapt on Sat, Oct 10, 7:24 PM.
Tags
None
Referenced Files
F175708670: D60594.id189395.diff
Mon, Oct 12, 4:38 PM
F175708480: D60594.id189396.diff
Mon, Oct 12, 4:36 PM
F175708140: D60594.diff
Mon, Oct 12, 4:32 PM
F175689935: D60594.diff
Mon, Oct 12, 1:32 PM
F175670869: D60594.id189395.diff
Mon, Oct 12, 10:10 AM
F175670470: D60594.id.diff
Mon, Oct 12, 10:05 AM
F175646267: D60594.diff
Mon, Oct 12, 6:31 AM
F175635223: D60594.id189396.diff
Mon, Oct 12, 4:57 AM
Subscribers

Details

Summary

Handle the Captive Portal option (37) found in Router Advertisements.
The advertised API URL is written to /var/run/captive-portal6.IFACE

Test Plan

I have not been able to test anything for this one beside mocking, so I have no idea if it will work for real or not as I haven't got access to any real ipv6 only captive portal.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77975
Build 74858: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Sat, Oct 10, 7:24 PM
bapt edited the test plan for this revision. (Show Details)

Thanks for the opportunity to test and review this enhancement. I'm more of a vibe programmer than a professional developer, but I've tested it with net/radvd from the ports tree.

At first glance, it almost works as expected. One thing I noticed is that CAP_SEEK is also required to save the file in capability mode.

It's also worth noting that net/radvd cannot currently advertise URIs longer than 255 bytes, so I couldn't test longer URIs with it.

usr.sbin/rtsold/rtsol.c
526

Please add ND_OPT_CAPTIVE_PORTAL to sys/netinet/icmp6.h

536

Perhaps we should also impose a 255-byte URI limit ?

In Section 2, it's described: "As the maximum length of the URI that can be carried in IPv4 DHCP is 255 bytes, URIs longer than this SHOULD NOT be provisioned by any of the IPv6 options described in this document. In IPv6-only environments, this restriction can be relaxed."

In Section 2.3 of the RFC, we read: "As the maximum length of the URI that can be carried in IPv4 DHCP is 255 bytes, URIs longer than this SHOULD NOT be provisioned via IPv6 RA options."

usr.sbin/rtsold/rtsold.c
295–296

We also need CAP_SEEK here.

usr.sbin/rtsold/rtsol.c
536

Perhaps we should also impose a 255-byte URI limit ?

In Section 2, it's described: "As the maximum length of the URI that can be carried in IPv4 DHCP is 255 bytes, URIs longer than this SHOULD NOT be provisioned by any of the IPv6 options described in this document. In IPv6-only environments, this restriction can be relaxed."

In Section 2.3 of the RFC, we read: "As the maximum length of the URI that can be carried in IPv4 DHCP is 255 bytes, URIs longer than this SHOULD NOT be provisioned via IPv6 RA options."

RFC 8910 allows this restriction to be relaxed in IPv6-only environments, so imposing a 255-byte URI limit in rtsol is probably unnecessary. We can leave URI length handling to the router advertisement daemon.

ziaee added inline comments.
usr.sbin/rtsold/rtsold.8
300

see below for explaination

303–314
  • width aligned, and the style guides all quote this
  • interface is gratuitously long, this is already pretty long because of the text justification
  • Use angle quotes to make the "Ar" a bit clearer in different rendering outputs
  • The FILES section is an index of the files. The full verbose description belongs in DESCRIPTION.

And, to be honest, these descriptions should all be lowercase with no periods, because they are not sentences and this is just an index, but pre-existing issues are out of scope.