Skip to content

Commit bd356de

Browse files
committed
Revert "Revert "Add clang and CyaSSL to the build matrix""
1 parent 8f39932 commit bd356de

File tree

5 files changed

+87
-10
lines changed

5 files changed

+87
-10
lines changed

.travis.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
# Use newer, container based infrastructure
2+
# Does not allow use of apt-get, but enables
3+
# caching support
4+
sudo: false
15
language: c
26
compiler:
37
- gcc
8+
- clang
49
install:
510
- ./autogen.sh
611
script:
7-
- ./configure && make
12+
- ./.travis_configure_wrapper.sh && make
13+
env:
14+
global:
15+
- CFLAGS="-Werror"
16+
matrix:
17+
- BUILD_TYPE=normal
18+
- CYASSL="3.3.2" BUILD_TYPE=cyassl
19+
cache:
20+
directories:
21+
- dependencies-src
22+
- dependencies-installed

.travis_configure_wrapper.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ -z "$BUILD_TYPE" ]]; then
4+
echo "BUILD_TYPE not set. Bye."
5+
exit 1
6+
fi
7+
8+
if [[ "$BUILD_TYPE" == "normal" ]]; then
9+
10+
echo "Running Wifidog configure"
11+
./configure $@
12+
13+
elif [[ "$BUILD_TYPE" == "cyassl" ]]; then
14+
if [[ -z "$CYASSL" ]]; then
15+
echo "CYASSL not set."
16+
exit 1
17+
fi
18+
CUR=`pwd`
19+
mkdir -p dependencies-src || true
20+
mkdir -p dependencies-installed || true
21+
if [[ ! -f dependencies-installed/include/cyassl/ssl.h ]]; then
22+
echo "Cached CyaSSL install not found. Installing."
23+
cd dependencies-src
24+
# Check if travis cache is there
25+
if [[ -f cyassl-${CYASSL}/autogen.sh ]]; then
26+
echo "Found cached CyaSSL package"
27+
else
28+
echo "No cache, downloading CyaSSL"
29+
wget https://github.com/cyassl/cyassl/archive/v${CYASSL}.tar.gz \
30+
-O cyassl-${CYASSL}.tar.gz
31+
tar -xzf cyassl-${CYASSL}.tar.gz
32+
fi
33+
cd cyassl-${CYASSL}
34+
echo "Content of cyassl-${CYASSL}:"
35+
ls
36+
echo "Running CyaSSL autogen.sh"
37+
./autogen.sh
38+
echo "Running CyaSSL configure"
39+
./configure --prefix="$CUR"/dependencies-installed/ --enable-ecc
40+
# make will pick up the cached object files - real savings
41+
# happen here
42+
echo "Running CyaSSL make"
43+
make
44+
echo "Running CyaSSL make install"
45+
make install
46+
cd "$CUR"
47+
else
48+
echo "Cached CyaSSL install found."
49+
fi
50+
echo "Running Wifidog configure"
51+
export CFLAGS="-I${CUR}/dependencies-installed/include/"
52+
export LDFLAGS="-L${CUR}/dependencies-installed/lib/"
53+
./configure --enable-cyassl $@
54+
else
55+
echo "Unknow BUILD_TYPE $BUILD_TYPE"
56+
exit 1
57+
fi

libhttpd/ip_acl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ char *cidr;
122122
int action;
123123
{
124124
httpAcl *cur;
125-
int addr, len;
125+
unsigned int addr;
126+
unsigned int len;
126127

127128
/*
128129
** Check the ACL info is reasonable
@@ -165,7 +166,9 @@ int
165166
httpdCheckAcl(httpd * server, request * r, httpAcl * acl)
166167
{
167168
httpAcl *cur;
168-
int addr, len, res, action;
169+
unsigned int addr;
170+
unsigned int len;
171+
int res, action;
169172

170173
action = HTTP_ACL_DENY;
171174
res = scanCidr(r->clientAddr, &addr, &len); /* Returns -1 on conversion failure. */

libhttpd/protocol.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ int outbufsize;
256256
}
257257

258258
char
259-
_httpd_from_hex(c)
260-
char c;
259+
_httpd_from_hex(char c)
261260
{
262261
return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c - 'a' + 10; /* accept small letters just in case */
263262
}

src/conf.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,11 +875,14 @@ void parse_trusted_mac_list(const char *ptr) {
875875
config.trustedmaclist->next = NULL;
876876
} else {
877877
/* Advance to the last entry */
878-
for (p = config.trustedmaclist; p->next != NULL; p = p->next);
879-
p->next = safe_malloc(sizeof(t_trusted_mac));
880-
p = p->next;
881-
p->mac = safe_strdup(mac);
882-
p->next = NULL;
878+
p = config.trustedmaclist;
879+
while (p->next != NULL) {
880+
p = p->next;
881+
}
882+
p->next = safe_malloc(sizeof(t_trusted_mac));
883+
p = p->next;
884+
p->mac = safe_strdup(mac);
885+
p->next = NULL;
883886
}
884887
}
885888
}

0 commit comments

Comments
 (0)