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.
This commit is contained in:
Jouni Malinen 2009-12-12 16:46:33 +02:00
parent ad1f0291f8
commit d0d45d8276
3 changed files with 1 additions and 14 deletions

View file

@ -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) {

View file

@ -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 *

View file

@ -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 || if (wps_registrar_set_selected_registrar(sm->wps->registrar, msg)) {
sm->ctx->rx_req_set_selected_registrar(sm->priv, msg)) {
wpabuf_free(msg); wpabuf_free(msg);
return HTTP_INTERNAL_SERVER_ERROR; return HTTP_INTERNAL_SERVER_ERROR;
} }