]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ndisc: reject malformed captive portal URI with EBADMSG 28232/head
authorRonan Pigott <ronan@rjp.ie>
Mon, 3 Jul 2023 10:07:57 +0000 (03:07 -0700)
committerRonan Pigott <ronan@rjp.ie>
Mon, 3 Jul 2023 10:07:57 +0000 (03:07 -0700)
This allows the correct, gracious, error handling to follow up in the
ndisc handler. Otherwise, an internal error is assumed and the interface
disabled.

Fixes: 9747955d2d60 ("ndisc: parse RFC8910 captive portal ipv6ra option")
src/network/networkd-ndisc.c

index 025deeff90055c62c687181e1b003d7f8dc5e53c..8115595dc5c8731438754103774be16a684c8963 100644 (file)
@@ -743,7 +743,7 @@ static int ndisc_router_process_captive_portal(Link *link, sd_ndisc_router *rt)
                 return r;
 
         if (!in_charset(captive_portal, URI_VALID))
-                return -EINVAL;
+                return -EBADMSG;
 
         if (!streq_ptr(link->ndisc_captive_portal, captive_portal)) {
                 free_and_replace(link->ndisc_captive_portal, captive_portal);