diff mbox

hostapd: Remove redundant freeing of STA list entries

Message ID 1368702844-7147-1-git-send-email-mohammed@qca.qualcomm.com
State Changes Requested
Headers show

Commit Message

Mohammed Shafi Shajakhan May 16, 2013, 11:14 a.m. UTC
From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

hostapd_flush_old_stations does this appropriately
after flushing the STA entries in the driver.

Signed-hostap: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 src/ap/hostapd.c |    2 --
 1 file changed, 2 deletions(-)

Comments

Jouni Malinen May 16, 2013, 5:55 p.m. UTC | #1
On Thu, May 16, 2013 at 04:44:04PM +0530, Mohammed Shafi Shajakhan wrote:
> hostapd_flush_old_stations does this appropriately
> after flushing the STA entries in the driver.

The hostapd_free_stas() call in hostapd_flush_old_stations() is
conditional, i.e., the call here would still be needed for the
driver=none case.
Mohammed Shafi Shajakhan May 17, 2013, 5:19 a.m. UTC | #2
Hi Jouni,

On Thu, May 16, 2013 at 08:55:00PM +0300, Jouni Malinen wrote:
> On Thu, May 16, 2013 at 04:44:04PM +0530, Mohammed Shafi Shajakhan wrote:
> > hostapd_flush_old_stations does this appropriately
> > after flushing the STA entries in the driver.
> 
> The hostapd_free_stas() call in hostapd_flush_old_stations() is
> conditional, i.e., the call here would still be needed for the
> driver=none case.

does driver=none maintains a sta list ?

>  
> -- 
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
Jouni Malinen May 19, 2013, 7:28 p.m. UTC | #3
On Fri, May 17, 2013 at 10:49:14AM +0530, Mohammed Shafi Shajakhan wrote:
> On Thu, May 16, 2013 at 08:55:00PM +0300, Jouni Malinen wrote:
> > On Thu, May 16, 2013 at 04:44:04PM +0530, Mohammed Shafi Shajakhan wrote:
> > > hostapd_flush_old_stations does this appropriately
> > > after flushing the STA entries in the driver.
> > 
> > The hostapd_free_stas() call in hostapd_flush_old_stations() is
> > conditional, i.e., the call here would still be needed for the
> > driver=none case.
> 
> does driver=none maintains a sta list ?

Probably not for most use cases, but it could potentially be used for
RSN pre-authentication testing where a STA entry may be created.

Does this patch fix something or is it just cleanup?
Mohammed Shafi Shajakhan May 21, 2013, 5:16 a.m. UTC | #4
On Sun, May 19, 2013 at 10:28:24PM +0300, Jouni Malinen wrote:
> On Fri, May 17, 2013 at 10:49:14AM +0530, Mohammed Shafi Shajakhan wrote:
> > On Thu, May 16, 2013 at 08:55:00PM +0300, Jouni Malinen wrote:
> > > On Thu, May 16, 2013 at 04:44:04PM +0530, Mohammed Shafi Shajakhan wrote:
> > > > hostapd_flush_old_stations does this appropriately
> > > > after flushing the STA entries in the driver.
> > > 
> > > The hostapd_free_stas() call in hostapd_flush_old_stations() is
> > > conditional, i.e., the call here would still be needed for the
> > > driver=none case.
> > 
> > does driver=none maintains a sta list ?
> 
> Probably not for most use cases, but it could potentially be used for
> RSN pre-authentication testing where a STA entry may be created.
> 
> Does this patch fix something or is it just cleanup?

no Jouni, its a cleanup, haven't found any issue that this fixes.

> 
> -- 
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
diff mbox

Patch

diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index bd91ad1..df9f6fa 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -1057,7 +1057,6 @@  void hostapd_interface_deinit(struct hostapd_iface *iface)
 	hostapd_cleanup_iface_pre(iface);
 	for (j = 0; j < iface->num_bss; j++) {
 		struct hostapd_data *hapd = iface->bss[j];
-		hostapd_free_stas(hapd);
 		hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
 		hostapd_clear_wep(hapd);
 		hostapd_cleanup(hapd);
@@ -1151,7 +1150,6 @@  int hostapd_disable_iface(struct hostapd_iface *hapd_iface)
 	/* whatever hostapd_interface_deinit does */
 	for (j = 0; j < hapd_iface->num_bss; j++) {
 		struct hostapd_data *hapd = hapd_iface->bss[j];
-		hostapd_free_stas(hapd);
 		hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
 		hostapd_clear_wep(hapd);
 		hostapd_free_hapd_data(hapd);