TDLS: Use wpa_tdls_disable_peer_link() in TPK M1 processing
authorSunil Dutt <c_duttus@qti.qualcomm.com>
Mon, 30 Sep 2013 14:36:26 +0000 (17:36 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 30 Sep 2013 14:36:26 +0000 (17:36 +0300)
This function is used only with external setup, so this can cleaned up
to use simpler design.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/rsn_supp/tdls.c

index 2218b46..41ab3fc 100644 (file)
@@ -1479,19 +1479,7 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
                        wpa_printf(MSG_DEBUG, "TDLS: TDLS Setup Request while "
                                   "direct link is enabled - tear down the "
                                   "old link first");
-#if 0
-                       /* TODO: Disabling the link would be more proper
-                        * operation here, but it seems to trigger a race with
-                        * some drivers handling the new request frame. */
-                       wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, src_addr);
-#else
-                       if (sm->tdls_external_setup)
-                               wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK,
-                                                src_addr);
-                       else
-                               wpa_tdls_del_key(sm, peer);
-#endif
-                       wpa_tdls_peer_free(sm, peer);
+                       wpa_tdls_disable_peer_link(sm, peer);
                }
 
                /*
@@ -1512,12 +1500,7 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
                                           MACSTR " (terminate previously "
                                           "initiated negotiation",
                                           MAC2STR(src_addr));
-                               if (sm->tdls_external_setup)
-                                       wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK,
-                                                        src_addr);
-                               else
-                                       wpa_tdls_del_key(sm, peer);
-                               wpa_tdls_peer_free(sm, peer);
+                               wpa_tdls_disable_peer_link(sm, peer);
                        }
                }
        }