rework socket and discovery handling
Swtich sockets to connected when talking to a specific AC. Use unconnected UDP sockets only during DISCOVERY. In JOIN, we need send our local address. The old, routing table based local address discovery is broken for many reasons (VRF, policy routing, ...). With a connected socket, we can the same information with a simple getsockname. During DISCOVERY we are talking to all potential AC's at once. So using an unconnected socket makes still sense.
This commit is contained in:
@ -363,8 +363,9 @@ int wtp_dfa_running(void) {
|
||||
int check;
|
||||
|
||||
/* Check source */
|
||||
if (capwap_compare_ip(&g_wtp.dtls.peeraddr, &fromaddr)) {
|
||||
capwap_logging_debug("WTP compare failed, drop packet");
|
||||
if (g_wtp.state != CAPWAP_DISCOVERY_STATE &&
|
||||
capwap_compare_ip(&g_wtp.dtls.peeraddr, &fromaddr)) {
|
||||
capwap_logging_debug("CAPWAP packet from unknown WTP when not in DISCOVERY, drop packet");
|
||||
continue; /* Unknown source */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user