[PATCH] command to disable eapol ip functionality from both Go and client side

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 4ddc16d612224a71b1ac0204f6721aa182d3d007 Mon Sep 17 00:00:00 2001
From: Avichal <avichal.a@xxxxxxxxxxx>
Date: Mon, 14 Mar 2016 21:00:22 +0900
Subject: [PATCH] command to disable eapol ip functionality from both Go and
 client side

if p2p_set disable_eapol_ip_addr  1 then ip eapol will be diabled
if 0 then enabled . By default it is enabled. Previously only client
can disable the eapol ip request. Now through this patch At Go side  also
ip eapol fucntionality can be disabled.

Signed-off-by: Avichal Agarwal <avichal.a@xxxxxxxxxxx>
Signed-off-by: Kyeong-Chae Lim <kcya.lim@xxxxxxxxxxx>
---
 src/p2p/p2p.c                     |   11 +++++++++++
 src/p2p/p2p.h                     |    5 +++++
 wpa_supplicant/ctrl_iface.c       |    6 +++---
 wpa_supplicant/p2p_supplicant.c   |    6 ++++++
 wpa_supplicant/p2p_supplicant.h   |    2 +-
 wpa_supplicant/wpa_supplicant_i.h |    1 -
 wpa_supplicant/wpas_glue.c        |    3 +--
 7 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 6942c85..326c49e 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2941,6 +2941,7 @@ struct p2p_data * p2p_init(const struct p2p_config *cfg)
 	p2p->go_timeout = 100;
 	p2p->client_timeout = 20;
 	p2p->num_p2p_sd_queries = 0;
+	p2p->disable_eapolip = 0;
 
 	p2p_dbg(p2p, "initialized");
 	p2p_channels_dump(p2p, "channels", &p2p->cfg->channels);
@@ -5488,3 +5489,13 @@ void p2p_set_own_pref_freq_list(struct p2p_data *p2p,
 			i, p2p->pref_freq_list[i]);
 	}
 }
+
+void p2p_eapol_ip_flag_set(struct p2p_data *p2p,int flag)
+{
+	p2p->disable_eapolip = flag;
+}
+
+int p2p_eapol_ip_flag_get(struct p2p_data *p2p)
+{
+	return p2p->disable_eapolip;
+}
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index fc545b4..4ed66dd 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -2367,4 +2367,9 @@ void p2p_set_own_pref_freq_list(struct p2p_data *p2p,
 int p2p_group_get_common_freqs(struct p2p_group *group, int *common_freqs,
 			       unsigned int *num);
 
+void p2p_eapol_ip_flag_set(struct p2p_data *p2p,int flag);
+
+int p2p_eapol_ip_flag_get(struct p2p_data *p2p);
+
+
 #endif /* P2P_H */
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 4e16987..ad6e965 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -6097,8 +6097,8 @@ static int p2p_ctrl_set(struct wpa_supplicant *wpa_s, char *cmd)
 		return wpas_p2p_nfc_tag_enabled(wpa_s, !!atoi(param));
 #endif /* CONFIG_WPS_NFC */
 
-	if (os_strcmp(cmd, "disable_ip_addr_req") == 0) {
-		wpa_s->p2p_disable_ip_addr_req = !!atoi(param);
+	if (os_strcmp(cmd, "disable_eapol_ip_addr") == 0) {
+		wpas_p2p_eapolip_flag_set(wpa_s, atoi(param));
 		return 0;
 	}
 
@@ -7017,7 +7017,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
 	p2p_wpa_s->global->p2p_disabled = 0;
 	p2p_wpa_s->global->p2p_per_sta_psk = 0;
 	p2p_wpa_s->conf->num_sec_device_types = 0;
-	p2p_wpa_s->p2p_disable_ip_addr_req = 0;
+	wpas_p2p_eapolip_flag_set(wpa_s,0);
 	os_free(p2p_wpa_s->global->p2p_go_avoid_freq.range);
 	p2p_wpa_s->global->p2p_go_avoid_freq.range = NULL;
 	p2p_wpa_s->global->p2p_go_avoid_freq.num = 0;
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 5ff758f..fe9dacb 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -9192,3 +9192,9 @@ void wpas_p2p_ap_deinit(struct wpa_supplicant *wpa_s)
 		wpa_s->ap_iface->bss[0]->p2p_group = NULL;
 	wpas_p2p_group_deinit(wpa_s);
 }
+
+void wpas_p2p_eapolip_flag_set(struct wpa_supplicant *wpa_s, int flag)
+{
+	if(wpa_s->global->p2p)
+	  p2p_eapol_ip_flag_set(wpa_s->global->p2p,flag);
+}
diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h
index 6a770d2..a72d301 100644
--- a/wpa_supplicant/p2p_supplicant.h
+++ b/wpa_supplicant/p2p_supplicant.h
@@ -167,7 +167,7 @@ int wpas_p2p_nfc_tag_enabled(struct wpa_supplicant *wpa_s, int enabled);
 void wpas_p2p_pbc_overlap_cb(void *eloop_ctx, void *timeout_ctx);
 
 #ifdef CONFIG_P2P
-
+void wpas_p2p_eapolip_flag_set(struct wpa_supplicant *wpa_s, int flag);
 int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s);
 void wpas_p2p_deinit(struct wpa_supplicant *wpa_s);
 void wpas_p2p_completed(struct wpa_supplicant *wpa_s);
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 269bac0..272f8cb 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -853,7 +853,6 @@ struct wpa_supplicant {
 	int p2p_first_connection_timeout;
 	unsigned int p2p_nfc_tag_enabled:1;
 	unsigned int p2p_peer_oob_pk_hash_known:1;
-	unsigned int p2p_disable_ip_addr_req:1;
 	unsigned int p2ps_method_config_any:1;
 	unsigned int p2p_cli_probe:1;
 	int p2p_persistent_go_freq;
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index f84c8b9..59c5062 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -1117,8 +1117,7 @@ void wpa_supplicant_rsn_supp_set_config(struct wpa_supplicant *wpa_s,
 		conf.ssid_len = ssid->ssid_len;
 		conf.wpa_ptk_rekey = ssid->wpa_ptk_rekey;
 #ifdef CONFIG_P2P
-		if (ssid->p2p_group && wpa_s->current_bss &&
-		    !wpa_s->p2p_disable_ip_addr_req) {
+		if (ssid->p2p_group && wpa_s->current_bss && !p2p_eapol_ip_flag_get(wpa_s->global->p2p)){
 			struct wpabuf *p2p;
 			p2p = wpa_bss_get_vendor_ie_multi(wpa_s->current_bss,
 							  P2P_IE_VENDOR_TYPE);
-- 
1.7.9.5

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux