Skip to content

Commit 5d7f141

Browse files
committed
Fix build / CI
1 parent 4ca18e9 commit 5d7f141

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
- name: Build linux tests
2626
run: |
2727
mkdir -p build/port
28-
make CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1"
28+
make EXTRA_CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1"
29+
make EXTRA_CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1" build/raw_ping build/packet_ping
2930
3031
- name: Run standalone "event loop" test
3132
timeout-minutes: 5

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
CC?=gcc
22
CFLAGS:=-Wall -Werror -Wextra -I. -D_GNU_SOURCE
33
CFLAGS+=-g -ggdb -Wdeclaration-after-statement
4+
EXTRA_CFLAGS?=
5+
CFLAGS+=$(EXTRA_CFLAGS)
46
LDFLAGS+=-pthread
57
# additional debug flags:
68
# CFLAGS+=-DDEBUG_TAP
@@ -155,7 +157,7 @@ endif
155157
EXE=build/tcpecho build/tcp_netcat_poll build/tcp_netcat_select \
156158
build/test-evloop build/test-dns build/test-wolfssl-forwarding \
157159
build/test-ttl-expired build/test-wolfssl build/test-httpd \
158-
build/ipfilter-logger build/raw_ping build/packet_ping \
160+
build/ipfilter-logger \
159161
build/test-esp build/esp-server
160162
LIB=libwolfip.so
161163

src/wolfip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3891,6 +3891,9 @@ static struct packetsocket *wolfIP_packetsocket_from_fd(struct wolfIP *s, int so
38913891
int wolfIP_sock_socket(struct wolfIP *s, int domain, int type, int protocol)
38923892
{
38933893
struct tsocket *ts;
3894+
#if WOLFIP_RAWSOCKETS || WOLFIP_PACKET_SOCKETS
3895+
int base_type = type;
3896+
#endif
38943897
if (domain != AF_INET)
38953898
goto packet_try;
38963899
if (type == IPSTACK_SOCK_STREAM) {
@@ -3914,7 +3917,7 @@ int wolfIP_sock_socket(struct wolfIP *s, int domain, int type, int protocol)
39143917
}
39153918
}
39163919
#if WOLFIP_RAWSOCKETS
3917-
else if (type == IPSTACK_SOCK_RAW) {
3920+
else if (base_type == IPSTACK_SOCK_RAW) {
39183921
struct rawsocket *rs;
39193922
int hdrincl = 0;
39203923
#ifdef IPPROTO_RAW

0 commit comments

Comments
 (0)