]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix UNSUBSCRIBE to return 412 if no SID match found
authorJouni Malinen <j@w1.fi>
Sat, 22 Feb 2014 16:51:37 +0000 (18:51 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 22 Feb 2014 16:58:33 +0000 (18:58 +0200)
UPnP-arch-DeviceArchitecture describe ErrorCode 412 to be used for the
case where no un-epxired subscription matches. This used to return 200
which is not strictly speaking correct even though it is unlikely to
cause any problems.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/wps/wps_upnp_web.c

index 37bdc8e00731123f2d71484cf19874781d48bcc3..31963ffbcecc9fe54cd5856e080f669040f930bc 100644 (file)
@@ -1207,6 +1207,10 @@ static void web_connection_parse_unsubscribe(struct upnp_wps_device_sm *sm,
                                   sa->domain_and_port : "-null-");
                        dl_list_del(&s->list);
                        subscription_destroy(s);
+               } else {
+                       wpa_printf(MSG_INFO, "WPS UPnP: Could not find matching subscription to unsubscribe");
+                       ret = HTTP_PRECONDITION_FAILED;
+                       goto send_msg;
                }
        } else {
                wpa_printf(MSG_INFO, "WPS UPnP: Unsubscribe fails (not "