Join to a real vWLC works

FossilOrigin-Name: 924b4e58697b9cd2c2326f541e8cc302be46496c4b5ffb29d73fc305b5d7bf56
This commit is contained in:
7u83@mail.ru
2018-04-07 19:47:35 +00:00
parent d53b45ccb9
commit 572e1b6d97
10 changed files with 71 additions and 25 deletions

View File

@ -215,8 +215,8 @@
#define CW_ELEM_ADD_MAC_ACL_ENTRY 7
#define CW_ELEM_ADD_STATION 8
#define CW_ELEM_RESERVED_9 9
#define CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
#define CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
#define CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10
#define CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11
/**@}*/
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30
#define CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50

View File

@ -13,8 +13,8 @@ struct cw_StrListElem capwap_strings_elem[] = {
{CW_ELEM_ADD_MAC_ACL_ENTRY, "Add MAC ACL Entry"},
{CW_ELEM_ADD_STATION, "Add Station"},
{CW_ELEM_RESERVED_9, "Reserved 9"},
{CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, "Control IPv4 Address"},
{CW_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"},
{CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS, "Control IPv4 Address"},
{CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"},
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, "CAWPAP Local IPv4 Address"},
{CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address"},
{CW_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"},

View File

@ -295,14 +295,23 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
if (!message){
/* Message is unknown */
if (search.type & 1){
cw_dbg(DBG_MSG_ERR,
"Message type %d [%s] unrecognized, sending response.",
search.type, cw_strmsg(search.type),
cw_strstate(conn->capwap_state));
result_code = CAPWAP_RESULT_MSG_UNRECOGNIZED;
cw_send_error_response(conn, rawmsg, result_code);
errno = EAGAIN;
return -1;
}
cw_dbg(DBG_MSG_ERR,
"Message type %d (%s) unrecognized, sending response.",
search.type, cw_strmsg(search.type),
cw_strstate(conn->capwap_state));
result_code = CAPWAP_RESULT_MSG_UNRECOGNIZED;
cw_send_error_response(conn, rawmsg, result_code);
"Message type %d [%s] unrecognized, discarding.",
search.type, cw_strmsg(search.type),
cw_strstate(conn->capwap_state));
errno = EAGAIN;
return -1;
}
/* Throw away unexpected messages */

View File

@ -10,9 +10,6 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
cw_KTV_t mdata, *mresult;
int exists;
/* cw_dbg(DBG_ELEM,"KVStore (%p,%d) add elem (%s): %s", kvstore, kvstore->count,
type->name, key );
*/
mdata.key=cw_strdup(key);
if (!mdata.key){
cw_log(LOG_ERR, "Can't allocate memory for KTV key %s: %s",
@ -27,7 +24,8 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
free(mdata.key);
return NULL;
}
mavl_del(kvtstore,&mdata);
mresult = mavl_add(kvtstore, &mdata, &exists);
if (exists){
cw_log(LOG_ERR, "Element already exists %s", key);