Handles session id now
FossilOrigin-Name: 4e452538871d01fbb40697b1bc42292dce33b620bdf5911c40e1ed3a4814f803
This commit is contained in:
parent
348a1224d8
commit
9b76e5925e
@ -4,6 +4,8 @@
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "capwap_items.h"
|
||||
#include "format.h"
|
||||
#include "connlist.h"
|
||||
|
||||
int cw_in_check_join_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
||||
int len,struct sockaddr *from)
|
||||
@ -22,6 +24,17 @@ int cw_in_check_join_req(struct conn *conn, struct cw_action_in *a, uint8_t * da
|
||||
cw_dbg_missing_mand(DBG_RFC,conn,mlist,n,a);
|
||||
}
|
||||
|
||||
connlist_lock(conn->connlist);
|
||||
struct conn *cc = connlist_get_by_session_id(conn->connlist,conn);
|
||||
if (!cc){
|
||||
connlist_add_by_session_id(conn->connlist,conn);
|
||||
}
|
||||
connlist_unlock(conn->connlist);
|
||||
if (cc){
|
||||
cw_dbg(DBG_ELEM_ERR,"Session already in use %s",format_bin2hex(conn->session_id,16));
|
||||
conn->capwap_state=CW_STATE_JOIN;
|
||||
return CW_RESULT_JOIN_FAILURE_SESSION_ALREADY_IN_USE;
|
||||
}
|
||||
|
||||
/* set result code to ok and change to configure state */
|
||||
mbag_set_dword(conn->outgoing,CW_ITEM_RESULT_CODE,0);
|
||||
|
Loading…
Reference in New Issue
Block a user