diff --git a/src/Macros.mak b/src/Macros.mak index f7b435e4..4d0fe7ac 100644 --- a/src/Macros.mak +++ b/src/Macros.mak @@ -1,7 +1,6 @@ - -ifeq ($(USE_CONTRIB_OPENSSL),1) -OPENSSL_LIBS=../contrib/$(OPENSSL_VERSION)/libssl.a ../contrib/$(OPENSSL_VERSION)/libcrypto.a -ldl -OPENSSL_CFLAGS=../contrib/$(OPENSSL_VERSION)/include/ +ifeq (${USE_CONTRIB_OPENSSL},1) +OPENSSL_LIBS=../contrib/${OPENSSL_VERSION}/libssl.a ../contrib/${OPENSSL_VERSION}/libcrypto.a -ldl +OPENSSL_CFLAGS=../contrib/${OPENSSL_VERSION}/include/ else OPENSSL_LDFLAGS=-lssl -lcrypto -ldl OPENSSL_CFLAGS= diff --git a/src/ac/Makefile b/src/ac/Makefile index b8b658ec..0a689ce7 100644 --- a/src/ac/Makefile +++ b/src/ac/Makefile @@ -45,12 +45,19 @@ CFLAGS += -DWITH_IPV6 RM = /bin/rm -f +AC_MODULES = mod_cipwap.o + + # list of generated object files for AC. -AC_OBJS = wtplist.o wtpman.o conf.o ac_main.o \ - ac_interface.o \ - socklist.o \ - db.o \ - ac_global.o +AC_OBJS = \ + wtplist.o wtpman.o conf.o ac_main.o \ + ac_interface.o \ + socklist.o \ + db.o \ + ac_global.o \ + ${AC_MODULES} + + AC_SRCS = $(AC_OBJS:.o=.c) AC_DEPS := $(AC_OBJS:.o=.d) diff --git a/src/ac/ac.default.conf b/src/ac/ac.default.conf index 4615a0b6..de043c93 100644 --- a/src/ac/ac.default.conf +++ b/src/ac/ac.default.conf @@ -61,14 +61,14 @@ # with missing mandatory elements. # # Default: -# strict_capwap = 1 +# strict_capwap = on # strict_headers # # If set to 1, any malformed packets wil b thrown away. # # Default: -# strict_headers = 1 +# strict_headers = on # capwap_mode diff --git a/src/ac/ac_main.c b/src/ac/ac_main.c index 7cd9713c..4bf96a9c 100644 --- a/src/ac/ac_main.c +++ b/src/ac/ac_main.c @@ -290,6 +290,7 @@ int ac_run() void process_cw_ctrl_packet(int index, struct sockaddr *addr, uint8_t * buffer, int len) { + /* first of all check preamble */ int preamble = cw_get_hdr_preamble(buffer); diff --git a/src/ac/wtpman.c b/src/ac/wtpman.c index b1932927..44f585ea 100644 --- a/src/ac/wtpman.c +++ b/src/ac/wtpman.c @@ -105,6 +105,7 @@ int check_discovery(struct conn *conn, struct cw_action_in *a, uint8_t * data, i static void wtpman_run_discovery(void *arg) { + struct wtpman *wtpman = (struct wtpman *) arg; //struct cwrmsg *cwrmsg; @@ -583,12 +584,14 @@ void wtpman_lw_addpacket(struct wtpman *wtpman, uint8_t * packet, int len) void wtpman_start(struct wtpman *wtpman, int dtlsmode) { + if (dtlsmode) { cw_dbg(DBG_INFO, "Starting wtpman in DTLS mode"); pthread_create(&wtpman->thread, NULL, (void *) &wtpman_run, (void *) wtpman); } else { cw_dbg(DBG_INFO, "Starting wtpman in non-dtls mode"); + pthread_create(&wtpman->thread, NULL, (void *) &wtpman_run_discovery, (void *) wtpman); }