Parcourir la source

WPS: Remove unnecessary SetSelectedRegistrar callback

This can be handled internally within core WPS code, so there is no
need to go through wps_hostapd.c with a callback function that is just
calling back into the core WPS code.
Jouni Malinen il y a 15 ans
Parent
commit
d0d45d8276
3 fichiers modifiés avec 1 ajouts et 14 suppressions
  1. 0 10
      hostapd/wps_hostapd.c
  2. 0 2
      src/wps/wps_upnp.h
  3. 1 2
      src/wps/wps_upnp_web.c

+ 0 - 10
hostapd/wps_hostapd.c

@@ -917,14 +917,6 @@ static int hostapd_rx_req_put_wlan_response(
 }
 }
 
 
 
 
-static int hostapd_rx_req_set_selected_registrar(void *priv,
-						 const struct wpabuf *msg)
-{
-	struct hostapd_data *hapd = priv;
-	return wps_registrar_set_selected_registrar(hapd->wps->registrar, msg);
-}
-
-
 static int hostapd_wps_upnp_init(struct hostapd_data *hapd,
 static int hostapd_wps_upnp_init(struct hostapd_data *hapd,
 				 struct wps_context *wps)
 				 struct wps_context *wps)
 {
 {
@@ -939,8 +931,6 @@ static int hostapd_wps_upnp_init(struct hostapd_data *hapd,
 	ctx->rx_req_get_device_info = hostapd_rx_req_get_device_info;
 	ctx->rx_req_get_device_info = hostapd_rx_req_get_device_info;
 	ctx->rx_req_put_message = hostapd_rx_req_put_message;
 	ctx->rx_req_put_message = hostapd_rx_req_put_message;
 	ctx->rx_req_put_wlan_response = hostapd_rx_req_put_wlan_response;
 	ctx->rx_req_put_wlan_response = hostapd_rx_req_put_wlan_response;
-	ctx->rx_req_set_selected_registrar =
-		hostapd_rx_req_set_selected_registrar;
 
 
 	hapd->wps_upnp = upnp_wps_device_init(ctx, wps, hapd);
 	hapd->wps_upnp = upnp_wps_device_init(ctx, wps, hapd);
 	if (hapd->wps_upnp == NULL) {
 	if (hapd->wps_upnp == NULL) {

+ 0 - 2
src/wps/wps_upnp.h

@@ -34,8 +34,6 @@ struct upnp_wps_device_ctx {
 		void *priv, enum upnp_wps_wlanevent_type ev_type,
 		void *priv, enum upnp_wps_wlanevent_type ev_type,
 		const u8 *mac_addr, const struct wpabuf *msg,
 		const u8 *mac_addr, const struct wpabuf *msg,
 		enum wps_msg_type msg_type);
 		enum wps_msg_type msg_type);
-	int (*rx_req_set_selected_registrar)(void *priv,
-					     const struct wpabuf *msg);
 };
 };
 
 
 struct upnp_wps_device_sm *
 struct upnp_wps_device_sm *

+ 1 - 2
src/wps/wps_upnp_web.c

@@ -520,8 +520,7 @@ web_process_set_selected_registrar(struct upnp_wps_device_sm *sm, char *data,
 	msg = xml_get_base64_item(data, "NewMessage", &ret);
 	msg = xml_get_base64_item(data, "NewMessage", &ret);
 	if (msg == NULL)
 	if (msg == NULL)
 		return ret;
 		return ret;
-	if (!sm->ctx->rx_req_set_selected_registrar ||
-	    sm->ctx->rx_req_set_selected_registrar(sm->priv, msg)) {
+	if (wps_registrar_set_selected_registrar(sm->wps->registrar, msg)) {
 		wpabuf_free(msg);
 		wpabuf_free(msg);
 		return HTTP_INTERNAL_SERVER_ERROR;
 		return HTTP_INTERNAL_SERVER_ERROR;
 	}
 	}