diff --git a/Makefile b/Makefile index 6fc2dfd6..d99b5b7e 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ HAVE_MBEDTLS = yes ifeq ($(HAVE_MBEDTLS), yes) DTLS_SRCS = dtls.c DTLS_OBJS = dtls.o -DTLS_CFLAGS = -Imbedtls_build/include -DTLS_LDFLAGS = -Lmbedtls_build/library +DTLS_CFLAGS = +DTLS_LDFLAGS = DTLS_LDLIBS = -lmbedtls -lmbedx509 -lmbedcrypto DTLS_DEFINES = -DHAVE_MBEDTLS -DUSE_MBEDTLS_TEST_CERTS endif diff --git a/babeld.c b/babeld.c index 6b80c907..81d6f6ad 100644 --- a/babeld.c +++ b/babeld.c @@ -903,7 +903,7 @@ main(int argc, char **argv) dtls->timer_status = 2; printf("DTLS: timer 2 expired\n"); rc = dtls_handshake(neigh); - if (rc) { + if(rc) { fprintf(stderr, "DTLS: timer handshake failed?\n"); } } else if(timeval_compare(&now, &dtls->int_time) >= 0) { diff --git a/configuration.c b/configuration.c index e896b86e..cd9b5aea 100644 --- a/configuration.c +++ b/configuration.c @@ -578,7 +578,7 @@ parse_anonymous_ifconf(int c, gnc_t gnc, void *closure, goto error; if_conf->unicast = v; #ifdef HAVE_MBEDTLS - } else if (strcmp(token, "dtls") == 0) { + } else if(strcmp(token, "dtls") == 0) { int v; c = getbool(c, &v, gnc, closure); if(c < -1) diff --git a/dtls.c b/dtls.c index 983f8765..bafa2336 100644 --- a/dtls.c +++ b/dtls.c @@ -483,7 +483,7 @@ dtls_parse_packet(const struct sockaddr_in6 *from, struct interface *ifp, } else { printf("Trying handshake in parser\n"); rc = dtls_handshake(neigh); - if (rc) { + if(rc) { printf("Parser handshake failed?\n"); } } @@ -505,7 +505,7 @@ dtls_handshake(struct neighbour *neigh) * nothing and see what happens. */ print_mbedtls_err("mbedtls_ssl_handshake WRITE|ASYNC", rc); return rc; - } else if (rc == MBEDTLS_ERR_SSL_WANT_READ) { + } else if(rc == MBEDTLS_ERR_SSL_WANT_READ) { print_mbedtls_err("mbedtls_ssl_handshake READ", rc); return 0; } else if(rc == MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED) { @@ -554,7 +554,7 @@ dtls_send(const void *buf1, int buflen1, const void *buf2, int buflen2, print_mbedtls_err("dtls_send mbedtls_ssl_write", rc); /* FIXME: what do we do? */ } - } else if (rc < len) { + } else if(rc < len) { buf += rc; len -= rc; goto partial_write; diff --git a/net.c b/net.c index 715a44b9..10707eda 100644 --- a/net.c +++ b/net.c @@ -147,7 +147,7 @@ babel_recv(int s, void *buf, int buflen, struct sockaddr *sin, int slen, if(rc < 0) return rc; - if (is_unicast != NULL) { + if(is_unicast != NULL) { *is_unicast = -1; for(cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL;