5795f96af7
FossilOrigin-Name: f02d9aed44b75fea91d9f860a1b24f06ca031bccae892681b577445fb1da3fad
41 lines
827 B
C
41 lines
827 B
C
|
|
#include "capwap.h"
|
|
#include "capwap_items.h"
|
|
|
|
#include "intavltree.h"
|
|
#include "log.h"
|
|
#include "dbg.h"
|
|
#include "sock.h"
|
|
|
|
int cw_in_check_disc_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
|
int len,struct sockaddr *from)
|
|
{
|
|
|
|
cw_action_in_t *mlist[120];
|
|
int n = cw_check_missing_mand(mlist, conn, a);
|
|
|
|
|
|
conn->capwap_state = CW_STATE_NONE;
|
|
|
|
if (n && conn->strict_capwap) {
|
|
cw_dbg_missing_mand(DBG_MSG_ERR, conn, mlist, n, a);
|
|
/* if mandatory elements are missing, in strict
|
|
mode send no discovery response */
|
|
cw_dbg(DBG_MSG_ERR,
|
|
"Ignoring Discovery Request from %s - missing mandatory elements.",
|
|
sock_addr2str(from));
|
|
return -1;
|
|
}
|
|
|
|
if ( n ) {
|
|
/* put a warning here */
|
|
cw_dbg_missing_mand(DBG_RFC, conn, mlist, n, a);
|
|
}
|
|
|
|
|
|
|
|
/* ok, send response */
|
|
|
|
return 0;
|
|
}
|