Skip to content

Commit bb07c81

Browse files
committed
Fix build / CI
1 parent 2c1fd4c commit bb07c81

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
@@ -35,7 +35,8 @@ jobs:
3535
- name: Build linux tests
3636
run: |
3737
mkdir -p build/port
38-
make CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1"
38+
make EXTRA_CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1"
39+
make EXTRA_CFLAGS="-DWOLFIP_RAWSOCKETS=1 -DWOLFIP_PACKET_SOCKETS=1" build/raw_ping build/packet_ping
3940
4041
- name: Run standalone "event loop" test
4142
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
@@ -157,7 +159,7 @@ endif
157159
EXE=build/tcpecho build/tcp_netcat_poll build/tcp_netcat_select \
158160
build/test-evloop build/test-dns build/test-wolfssl-forwarding \
159161
build/test-ttl-expired build/test-wolfssl build/test-httpd \
160-
build/ipfilter-logger build/raw_ping build/packet_ping \
162+
build/ipfilter-logger \
161163
build/test-esp build/esp-server
162164
ifeq ($(UNAME_S),Linux)
163165
EXE+= build/test-evloop-tun

src/wolfip.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4788,6 +4788,9 @@ static struct packetsocket *wolfIP_packetsocket_from_fd(struct wolfIP *s, int so
47884788
int wolfIP_sock_socket(struct wolfIP *s, int domain, int type, int protocol)
47894789
{
47904790
struct tsocket *ts;
4791+
#if WOLFIP_RAWSOCKETS || WOLFIP_PACKET_SOCKETS
4792+
int base_type = type;
4793+
#endif
47914794
if (domain != AF_INET)
47924795
goto packet_try;
47934796
if (type == IPSTACK_SOCK_STREAM) {
@@ -4811,7 +4814,7 @@ int wolfIP_sock_socket(struct wolfIP *s, int domain, int type, int protocol)
48114814
}
48124815
}
48134816
#if WOLFIP_RAWSOCKETS
4814-
else if (type == IPSTACK_SOCK_RAW) {
4817+
else if (base_type == IPSTACK_SOCK_RAW) {
48154818
struct rawsocket *rs;
48164819
int hdrincl = 0;
48174820
#ifdef IPPROTO_RAW

0 commit comments

Comments
 (0)