[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]

 



If we enable and disable the group capability field through a user flag then it will be more feasible and easy for the user 
to control the eapol ip functionality from go side. In last patch I left two files  changes , so sending the full  patch again.

>From 497472a1e913267d63ec813955de5ec4a16de4b1 Mon Sep 17 00:00:00 2001
From: Avichal Agarwal <avichal.a@xxxxxxxxxxx>
Date: Tue, 15 Mar 2016 11:47:51 +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 +++++
 src/p2p/p2p_group.c               |    3 ++-
 src/p2p/p2p_i.h                   |    1 +
 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 +--
 9 files changed, 30 insertions(+), 8 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/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
index 2cf2450..31db231 100644
--- a/src/p2p/p2p_group.c
+++ b/src/p2p/p2p_group.c
@@ -155,7 +155,8 @@ static void p2p_group_add_common_ies(struct p2p_group *group,
   group_capab |= P2P_GROUP_CAPAB_CROSS_CONN;
  if (group->num_members >= group->cfg->max_clients)
   group_capab |= P2P_GROUP_CAPAB_GROUP_LIMIT;
- group_capab |= P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION;
+ if(!(group->p2p->disable_eapolip))
+  group_capab |= P2P_GROUP_CAPAB_IP_ADDR_ALLOCATION;
  p2p_buf_add_capability(ie, dev_capab, group_capab);
 }
 
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index 47524d4..25e5646 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -288,6 +288,7 @@ struct p2p_data {
  const u8 *invite_go_dev_addr;
  u8 invite_go_dev_addr_buf[ETH_ALEN];
  int invite_dev_pw_id;
+ int disable_eapolip;
 
  unsigned int retry_invite_req:1;
  unsigned int retry_invite_req_sent:1;
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

------- Original Message -------
Sender : Jouni Malinen<j@xxxxx>
Date : Mar 15, 2016 03:10 (GMT+05:30)
Title : Re: [PATCH] command to disable eapol ip functionality from both Go and client side

On Mon, Mar 14, 2016 at 12:23:57PM +0000, Avichal Agarwal wrote:
> 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.

Could you please clarify why this is needed? The GO side functionality
for 4-way handshake based IP address assignment is enabled only if the
ip_addr_start parameter is set. Clearing that parameter disables this
functionality.

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap
_______________________________________________
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