Fixed a lot of IPV6 stuff.
FossilOrigin-Name: 30d5fde1afc089a036d5e8aa52211746f6666ffc83fd4b4a9a58e91f50576a00
This commit is contained in:
parent
70d5986760
commit
22820a911b
@ -73,6 +73,9 @@ cw_aciplist_t cw_select_ac(struct conn *conn, mbag_t dis)
|
||||
|
||||
DEFINE_AVLITER(i, dis);
|
||||
avliter_foreach(&i){
|
||||
|
||||
|
||||
|
||||
mbag_t ac = ((mbag_item_t *) (avliter_get(&i)))->data;
|
||||
|
||||
char *ac_name = mbag_get_str(ac, CW_ITEM_AC_NAME,NULL);
|
||||
@ -92,9 +95,17 @@ printf("nprio: %d\n",priolist->count);
|
||||
cw_aciplist_t acips =
|
||||
mbag_get_mavl(ac, CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST);
|
||||
|
||||
printf("Number of acips =%d\n",acips->count);
|
||||
|
||||
|
||||
DEFINE_AVLITER(i2, acips);
|
||||
avliter_foreach(&i2){
|
||||
|
||||
|
||||
cw_acip_t *acip = avliter_get(&i2);
|
||||
|
||||
printf("The acip: %s\n",sock_addr2str(&acip->ip));
|
||||
|
||||
cw_acip_t *n = malloc(sizeof(cw_acip_t));
|
||||
memcpy(n,acip,sizeof(cw_acip_t));
|
||||
|
||||
|
@ -102,14 +102,16 @@ int run_join_d(struct sockaddr *sa)
|
||||
int sockfd;
|
||||
int rc;
|
||||
|
||||
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
sockfd = socket(sa->sa_family, SOCK_DGRAM, 0);
|
||||
if (sockfd == -1) {
|
||||
cw_log(LOG_ERR, "Can't create socket: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
sock_set_recvtimeout(sockfd, 1);
|
||||
conn->sock = sockfd;
|
||||
sock_copyaddr(&conn->addr, sa);
|
||||
|
||||
rc = connect(sockfd, (struct sockaddr *) sa,
|
||||
/* rc = connect(sockfd, (struct sockaddr *) sa,
|
||||
sock_addrlen((struct sockaddr *) sa));
|
||||
|
||||
if (rc < 0) {
|
||||
@ -118,9 +120,7 @@ int run_join_d(struct sockaddr *sa)
|
||||
close(sockfd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
conn->sock = sockfd;
|
||||
sock_copyaddr(&conn->addr, sa);
|
||||
*/
|
||||
|
||||
cw_dbg(DBG_DTLS, "Establishing DTLS session with %s", sock_addr2str(sa));
|
||||
|
||||
@ -153,7 +153,7 @@ int run_join_d(struct sockaddr *sa)
|
||||
rc = dtls_connect(conn);
|
||||
if (rc != 1) {
|
||||
dtls_shutdown(conn);
|
||||
cw_log(LOG_ERR, "Can't establish DTLS connection to %s",
|
||||
cw_log(LOG_ERR, "Can't establish DTLS connection with %s",
|
||||
sock_addr2str(sa));
|
||||
close(sockfd);
|
||||
return 0;
|
||||
@ -226,12 +226,15 @@ int join()
|
||||
|
||||
cw_acip_t *ip = avliter_get(&ii);
|
||||
|
||||
|
||||
cw_dbg(DBG_INFO, "Going to join CAWAP controller on %s",
|
||||
sock_addr2str(&ip->ip));
|
||||
sock_addr2str_p(&ip->ip));
|
||||
|
||||
int rc = run_join_d((struct sockaddr *) &ip->ip);
|
||||
if (!rc)
|
||||
|
||||
if (rc<=0)
|
||||
continue;
|
||||
|
||||
rc = run_join(conn);
|
||||
if (rc) {
|
||||
conn->capwap_state = CW_STATE_CONFIGURE;
|
||||
|
Loading…
Reference in New Issue
Block a user