summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/run-tests-asan-ubsan.yml2
-rw-r--r--CHANGELOG.md12
-rw-r--r--CMakeLists.txt4
-rw-r--r--README.md29
-rw-r--r--accel-cmd/CMakeLists.txt5
-rw-r--r--accel-cmd/accel_cmd.c2
-rw-r--r--accel-cmd/accel_cmd_test.c46
-rw-r--r--cmake/centos/centos.cmake18
-rw-r--r--cmake/debian/debian.cmake11
-rw-r--r--docs/ng40-safeguards-review.md8
-rw-r--r--tests/README.md23
-rw-r--r--tests/kernel-module-install/test.sh31
-rw-r--r--tests/unit/dhcpv6_safeguards_test.c69
-rw-r--r--tests/unit/run_safeguards.sh6
14 files changed, 241 insertions, 25 deletions
diff --git a/.github/workflows/run-tests-asan-ubsan.yml b/.github/workflows/run-tests-asan-ubsan.yml
index 0ee2c755..77586419 100644
--- a/.github/workflows/run-tests-asan-ubsan.yml
+++ b/.github/workflows/run-tests-asan-ubsan.yml
@@ -64,6 +64,7 @@ jobs:
env:
${{ matrix.env_name }}: ${{ matrix.env_value }}
run: |
+ ctest --test-dir build --output-on-failure
gcc -O1 -g -Wall -fno-strict-aliasing -D_GNU_SOURCE \
-DOPENSSL_API_COMPAT=0x10100000L \
-fsanitize=${{ matrix.sanitizer }} -fno-sanitize-recover=all \
@@ -80,6 +81,7 @@ jobs:
/tmp/ipv6_dns_test
gcc -O2 -Wall -o /tmp/bitpool_test accel-pppd/extra/bitpool_test.c
/tmp/bitpool_test
+ sh tests/unit/run_safeguards.sh build
- name: Insert and check kernel modules (ipoe, vlan-mon, ppposeq)
# if: ${{ false }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af27812c..17e753d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -48,6 +48,8 @@
session interfaces with `ip link del`.
### Fixes
+- CLI: fix millisecond timeout conversion in accel-cmd so `1500ms` means
+ 1.5 seconds, as documented, instead of 1.0005 seconds.
- RADIUS: verify response authenticators against the request and secret
actually sent before delivering replies or updating server health.
Fix outbound Message-Authenticator calculation on retransmission and
@@ -88,6 +90,8 @@
VLAN monitoring packet-handler registration on Linux 6.6 and newer.
- Build / install: install kernel modules from their actual build
directories, honor `DESTDIR`, and propagate installation failures.
+- Packaging: include the optional PPPoSEQ kernel module in Debian and RPM
+ installation rules, including standalone driver packages.
### Docs
- Refreshed the README and synchronized the sample configuration and man
@@ -95,13 +99,13 @@
- Added contribution guidelines and a safeguard integration review.
- Corrected RADIUS option examples, shaper units and directions, kernel
module requirements, metrics freshness guidance, and the accel-cmd
- timeout synopsis. Updated test setup instructions and documented the
- current DHCPv6 safeguard fixture limitation.
+ timeout synopsis. Updated test setup instructions.
### Tests / CI
- Added focused suites for DHCPv6, RADIUS, VRF, LCP, memory pools, logging,
- L2TP, IPv6 DNS, and bitmap allocation. See `tests/README.md` for the
- current standalone safeguard runner limitation.
+ L2TP, IPv6 DNS, and bitmap allocation. Updated the DHCPv6 safeguard fixture
+ for shared DNS storage and bounded replies, and run all six standalone
+ safeguard suites in sanitizer CI.
- Added metrics, IPoE stale-interface cleanup and link deletion, PPPoE
negotiation, and kernel-module installation regression coverage.
- Added Ubuntu 26.04 coverage and removed Debian 11 jobs. Continue testing
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c856491..4d68b2bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,8 @@ endif ()
project(accel-ppp C)
+include(CTest)
+
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fno-strict-aliasing -D_GNU_SOURCE -fPIC -rdynamic -Wno-unused-result")
ADD_DEFINITIONS(-DOPENSSL_API_COMPAT=0x10100000L)
@@ -102,8 +104,6 @@ endif ()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-include(CTest)
-
if (BUILD_TESTING)
add_test(
NAME kernel-module-install
diff --git a/README.md b/README.md
index af678b9e..df116655 100644
--- a/README.md
+++ b/README.md
@@ -49,7 +49,9 @@ development libraries:
* Net-SNMP for NETSNMP=TRUE
* PostgreSQL client libraries for LOG_PGSQL_DEPRECATED=TRUE
-* Lua for LUA=TRUE or a specific Lua version such as LUA=5.3
+* Lua 5.1 development files for LUA=TRUE. A numeric value such as LUA=5.3
+ requests at least that Lua version through CMake's FindLua module; it does
+ not enforce an exact version.
Building and installing
@@ -57,12 +59,26 @@ Building and installing
Use an out-of-tree build directory:
+The commands below require CMake 3.15 or newer: -S/-B were added in 3.13,
+and --install was added in 3.15. The project itself still supports CMake 3.10.
+
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build
sudo cmake --install build
+For CMake 3.10 through 3.14, use the build-directory form and the generated
+install target instead:
+
+ mkdir -p build
+ cd build
+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
+ cmake --build .
+ sudo cmake --build . --target install
+
+Run the remaining examples from the repository root.
+
Useful build options:
* BUILD_IPOE_DRIVER=TRUE builds the IPoE kernel module.
@@ -259,5 +275,14 @@ More information
* Source and issue tracker: https://github.com/accel-ppp/accel-ppp
* Additional RADIUS notes: docs/
* Email: contact@accel-ppp.org
-* ICQ: 337258064
* Jabber: dima@accel-ppp.org
+
+
+Community resources
+===================
+
+These Telegram groups are unofficial community resources:
+
+* [English](https://t.me/accel_ppp_en)
+* [Brazilian Portuguese](https://t.me/accel_ppp_br)
+* [Russian](https://t.me/accel_ppp)
diff --git a/accel-cmd/CMakeLists.txt b/accel-cmd/CMakeLists.txt
index 4455c8df..115e67fc 100644
--- a/accel-cmd/CMakeLists.txt
+++ b/accel-cmd/CMakeLists.txt
@@ -6,6 +6,11 @@ ADD_EXECUTABLE(accel-cmd
accel_cmd.c
)
+if (BUILD_TESTING)
+ add_executable(accel-cmd-timeout-test accel_cmd_test.c)
+ add_test(NAME accel-cmd-timeout COMMAND accel-cmd-timeout-test)
+endif ()
+
INSTALL(TARGETS accel-cmd
RUNTIME DESTINATION bin
)
diff --git a/accel-cmd/accel_cmd.c b/accel-cmd/accel_cmd.c
index 3de8624f..6a6dc678 100644
--- a/accel-cmd/accel_cmd.c
+++ b/accel-cmd/accel_cmd.c
@@ -536,7 +536,7 @@ static int set_timespec(struct timespec *timeout, const char *str)
timeout->tv_nsec = 0;
} else if (strcmp(end, "ms") == 0) {
timeout->tv_sec = ulong / 1000;
- timeout->tv_nsec = (ulong % 1000) * 1000;
+ timeout->tv_nsec = (ulong % 1000) * 1000000;
} else if (strcmp(end, "us") == 0) {
timeout->tv_sec = ulong / 1000000;
timeout->tv_nsec = (ulong % 1000000) * 1000;
diff --git a/accel-cmd/accel_cmd_test.c b/accel-cmd/accel_cmd_test.c
new file mode 100644
index 00000000..a127caca
--- /dev/null
+++ b/accel-cmd/accel_cmd_test.c
@@ -0,0 +1,46 @@
+/* Exercise the production timeout parser without opening a connection. */
+#define main accel_cmd_main
+#include "accel_cmd.c"
+#undef main
+
+int main(void)
+{
+ static const struct {
+ const char *value;
+ time_t seconds;
+ long nanoseconds;
+ } cases[] = {
+ { "0", 0, 0 },
+ { "2s", 2, 0 },
+ { "0ms", 0, 0 },
+ { "1ms", 0, 1000000 },
+ { "500ms", 0, 500000000 },
+ { "999ms", 0, 999000000 },
+ { "1000ms", 1, 0 },
+ { "1001ms", 1, 1000000 },
+ { "1500ms", 1, 500000000 },
+ { "1us", 0, 1000 },
+ { "1500000us", 1, 500000000 },
+ };
+ static const char *invalid[] = { "", "-1ms", "1.5ms", "1m" };
+ struct timespec timeout;
+ size_t i;
+
+ for (i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
+ if (set_timespec(&timeout, cases[i].value) ||
+ timeout.tv_sec != cases[i].seconds ||
+ timeout.tv_nsec != cases[i].nanoseconds) {
+ fprintf(stderr, "incorrect timeout for %s\n", cases[i].value);
+ return 1;
+ }
+ }
+ for (i = 0; i < sizeof(invalid) / sizeof(invalid[0]); i++) {
+ if (!set_timespec(&timeout, invalid[i])) {
+ fprintf(stderr, "accepted invalid timeout %s\n", invalid[i]);
+ return 1;
+ }
+ }
+
+ puts("accel-cmd timeout parsing: PASS");
+ return 0;
+}
diff --git a/cmake/centos/centos.cmake b/cmake/centos/centos.cmake
index a0dcd279..00cd0c6a 100644
--- a/cmake/centos/centos.cmake
+++ b/cmake/centos/centos.cmake
@@ -1,6 +1,14 @@
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME})
+if (NOT DEFINED CENTOS_KDIR)
+ execute_process(
+ COMMAND uname -r
+ OUTPUT_VARIABLE CENTOS_KDIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+endif ()
+
if (BUILD_DRIVER_ONLY)
if (BUILD_IPOE_DRIVER)
SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
@@ -22,3 +30,13 @@ else (BUILD_DRIVER_ONLY)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/accel-pppd/accel-ppp.conf DESTINATION /etc RENAME accel-ppp.conf.dist)
endif (BUILD_DRIVER_ONLY)
+if (BUILD_PPPOSEQ_DRIVER)
+ if (BUILD_DRIVER_ONLY)
+ SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
+ SET(CPACK_PACKAGE_NAME "accel-ppp-ppposeq-kmod")
+ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp PPPoSEQ kernel module")
+ SET(CPACK_RPM_PACKAGE_REQUIRES "")
+ endif ()
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ppposeq/driver/ppposeq.ko DESTINATION /lib/modules/${CENTOS_KDIR}/extra)
+endif (BUILD_PPPOSEQ_DRIVER)
+
diff --git a/cmake/debian/debian.cmake b/cmake/debian/debian.cmake
index 89ab9993..1b6ab8ce 100644
--- a/cmake/debian/debian.cmake
+++ b/cmake/debian/debian.cmake
@@ -31,6 +31,17 @@ if (BUILD_VLAN_MON_DRIVER)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon/driver/vlan_mon.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra)
endif (BUILD_VLAN_MON_DRIVER)
+if (BUILD_PPPOSEQ_DRIVER)
+ if (BUILD_DRIVER_ONLY)
+ SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
+ SET(CPACK_PACKAGE_NAME "accel-ppp-ppposeq-kmod")
+ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp PPPoSEQ kernel module")
+ SET(CPACK_DEBIAN_PACKAGE_DEPENDS "")
+ SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst")
+ endif ()
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ppposeq/driver/ppposeq.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra)
+endif (BUILD_PPPOSEQ_DRIVER)
+
if (NOT BUILD_DRIVER_ONLY)
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/conffiles")
diff --git a/docs/ng40-safeguards-review.md b/docs/ng40-safeguards-review.md
index 8dfbe32e..9ba08977 100644
--- a/docs/ng40-safeguards-review.md
+++ b/docs/ng40-safeguards-review.md
@@ -107,10 +107,10 @@ git diff --check
```
For current checkouts, see the [focused unit test instructions](../tests/README.md#focused-unit-tests).
-The later IPv6 DNS storage refactor removed `conf_dns_count`, which the
-DHCPv6 fixture still references, and the runner needs to link `ipv6_dns.c`.
-The full command above therefore does not currently compile on master. The
-historical results below do not establish that the current full suite passes.
+The DHCPv6 fixture now uses the shared IPv6 DNS storage and its production
+implementation. It checks safe truncation of oversized DNS replies and
+failure propagation when domain-list options exhaust reply space. The
+sanitizer workflow also runs the complete standalone safeguard suite.
Build, the existing IPv6 DNS selection test, and five standalone suites passed. Tests compile production code with
small external-service stubs. DHCPv6, RADIUS, VRF, and pool tests use ASan,
diff --git a/tests/README.md b/tests/README.md
index 870cf8c8..44bae6a4 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -2,6 +2,11 @@
These tests are done for Ubuntu and Debian distros. Please use latest stable Debian or Ubuntu to run the tests.
+The commands in this guide require CMake/CTest 3.20 or newer, including
+`ctest --test-dir`. The standalone kernel-module installation script requires
+CMake 3.15 or newer for `cmake --install`. These command requirements are
+separate from the project's minimum CMake version of 3.10.
+
## Focused unit tests
The standalone unit tests compile production callbacks with small test fixtures
@@ -16,18 +21,14 @@ These tests do not require installed kernel modules or root privileges. The
sanitizer runtime needs an environment that permits its process inspection.
The runner has six suites: `dhcpv6`, `radius`, `vrf`, `lcp`, `mempool`, and
-`log_line`. With no names it attempts all six. The DHCPv6 fixture currently
-refers to the removed `conf_dns_count` variable, and the runner does not link
-the `ipv6_dns.c` implementation now used by the reply builder. That fixture
-and its build command must be updated before a full run can pass.
-
-The other five suites can be run explicitly while that regression is being fixed:
+`log_line`. With no names it runs all six:
```bash
-sh tests/unit/run_safeguards.sh build radius vrf lcp mempool log_line
+sh tests/unit/run_safeguards.sh build
```
-A successful subset run does not validate the DHCPv6 safeguards. The
+The DHCPv6 suite checks bounded DNS replies and failure propagation when
+non-truncatable options exhaust reply space. The
[integration validation record](../docs/ng40-safeguards-review.md#validation)
describes results from the revision at which those safeguards were introduced.
@@ -37,6 +38,9 @@ The kernel module installation regression test is rootless and does not need
kernel headers. It uses a fake kernel build tree to verify that `ipoe`,
`vlan_mon`, and `ppposeq` are installed from their actual build directories,
honor `DESTDIR`, and make installation fail when `modules_install` fails.
+It also verifies that Debian and CentOS packaging configurations include
+`ppposeq.ko` with the standalone driver package name, and omit it when the
+build flag is disabled.
Run it through CTest after configuring the project:
@@ -69,7 +73,8 @@ sudo apt install iproute2 ppp pppoe isc-dhcp-client
```
Install the build dependencies described in the project README, including
-kernel headers and Lua development files for the options below. Run these
+kernel headers and Lua 5.1 development files (`liblua5.1-0-dev` on Debian and
+Ubuntu) for `LUA=TRUE` below. Run these
commands from the repository root.
Install accel-pppd (make install or use distro package). Do not run accel-pppd using systemd or other supervisors
diff --git a/tests/kernel-module-install/test.sh b/tests/kernel-module-install/test.sh
index 1fbfd623..2f3ec579 100644
--- a/tests/kernel-module-install/test.sh
+++ b/tests/kernel-module-install/test.sh
@@ -36,3 +36,34 @@ if FAIL_MODULES_INSTALL=1 DESTDIR="${work_dir}/failed-stage" \
fi
grep -q 'Failed to install kernel module' "${work_dir}/failed-install.log"
+
+# Packaging configurations bypass modules_install and must install the .ko
+# explicitly, including when PPPoSEQ is built as a standalone driver package.
+for package_type in Debian12 Centos9; do
+ package_build="${work_dir}/package-${package_type}"
+ package_stage="${work_dir}/stage-${package_type}"
+ "${cmake_command}" \
+ -S "${source_dir}" \
+ -B "${package_build}" \
+ -DBUILD_TESTING=OFF \
+ -DBUILD_DRIVER_ONLY=TRUE \
+ -DBUILD_PPPOSEQ_DRIVER=TRUE \
+ -DIGNORE_GIT=TRUE \
+ -DCPACK_TYPE="${package_type}" \
+ -DMODULES_KDIR=test-kernel \
+ -DCENTOS_KDIR=test-kernel \
+ -DKDIR="${script_dir}"
+ "${cmake_command}" --build "${package_build}"
+ DESTDIR="${package_stage}" \
+ "${cmake_command}" --install "${package_build}"
+ test -f "${package_stage}/lib/modules/test-kernel/extra/ppposeq.ko"
+ grep -q 'set(CPACK_PACKAGE_NAME "accel-ppp-ppposeq-kmod")' \
+ "${package_build}/CPackConfig.cmake"
+
+ # A stale build artifact must not be installed after the flag is disabled.
+ "${cmake_command}" -S "${source_dir}" -B "${package_build}" \
+ -DBUILD_PPPOSEQ_DRIVER=FALSE
+ DESTDIR="${package_stage}-disabled" \
+ "${cmake_command}" --install "${package_build}"
+ test ! -e "${package_stage}-disabled/lib/modules/test-kernel/extra/ppposeq.ko"
+done
diff --git a/tests/unit/dhcpv6_safeguards_test.c b/tests/unit/dhcpv6_safeguards_test.c
index 63692ee3..0938047c 100644
--- a/tests/unit/dhcpv6_safeguards_test.c
+++ b/tests/unit/dhcpv6_safeguards_test.c
@@ -14,6 +14,7 @@ static size_t response_len;
void log_warn(const char *fmt, ...) {}
void log_emerg(const char *fmt, ...) {}
void log_ppp_error(const char *fmt, ...) {}
+void log_ppp_warn(const char *fmt, ...) {}
void log_ppp_info2(const char *fmt, ...) {}
int ip6addr_add_peer(int i, struct in6_addr *a, struct in6_addr *p) { return 0; }
int ip6route_add(int i, const struct in6_addr *a, int p, const struct in6_addr *g, int m, uint32_t prio, const char *v) { return 0; }
@@ -60,10 +61,36 @@ static size_t relay(unsigned char *buf, size_t len)
return len + hdrlen + 4;
}
+static void check_dns_reply(unsigned int requested)
+{
+ struct dhcpv6_packet *pkt;
+ struct dhcpv6_option *opt;
+ unsigned int count = 0;
+ size_t offset, len;
+
+ assert(sent == 1);
+ assert(response_len <= sizeof(response));
+ pkt = dhcpv6_packet_parse(response, response_len);
+ assert(pkt);
+ list_for_each_entry(opt, &pkt->opt_list, entry) {
+ if (ntohs(opt->hdr->code) != D6_OPTION_DNS_SERVERS)
+ continue;
+ len = ntohs(opt->hdr->len);
+ assert(len && len % sizeof(struct in6_addr) == 0);
+ for (offset = 0; offset < len; offset += sizeof(struct in6_addr))
+ assert(!memcmp(opt->hdr->data + offset, &in6addr_loopback,
+ sizeof(in6addr_loopback)));
+ count += len / sizeof(struct in6_addr);
+ }
+ assert(count > 0 && count < requested);
+ dhcpv6_packet_free(pkt);
+}
+
int main(void)
{
unsigned char buf[16000], oro[4000], name[256];
const unsigned char valid_name[] = {2, 'g', 'w', 0};
+ unsigned char domain[] = {1, 'x', 0};
struct dhcpv6_packet *pkt, *reply;
struct dhcpv6_option *opt;
struct ap_session ses = {0};
@@ -132,8 +159,27 @@ int main(void)
}
assert(!dhcpv6_packet_parse(buf, len));
- /* An ORO can amplify a small request into more than 4096 response bytes. */
- conf_dns_count = 1;
+ /* A large DNS list is truncated to the reply buffer capacity. */
+ assert(ipv6_dns_reserve(&conf_dns, 300) == 0);
+ for (i = 0; i < 300; i++)
+ conf_dns.addr[i] = in6addr_loopback;
+ conf_dns.count = 300;
+ u_write_be16(oro, D6_OPTION_DNS_SERVERS);
+ len = request(buf);
+ len += option(buf + len, D6_OPTION_ORO, oro, 2);
+ pkt = dhcpv6_packet_parse(buf, len);
+ assert(pkt);
+ pkt->ses = &ses;
+ sent = 0;
+ dhcpv6_send_reply(pkt, &pd, D6_REPLY);
+ check_dns_reply(conf_dns.count);
+ sent = 0;
+ dhcpv6_send_reply2(pkt, &pd, D6_REPLY);
+ check_dns_reply(conf_dns.count);
+ dhcpv6_packet_free(pkt);
+
+ /* Repeated ORO entries leave no room for the final Preference option. */
+ conf_dns.count = 1;
for (i = 0; i < sizeof(oro); i += 2)
u_write_be16(oro + i, D6_OPTION_DNS_SERVERS);
len = request(buf);
@@ -147,6 +193,25 @@ int main(void)
dhcpv6_send_reply2(pkt, &pd, D6_REPLY);
assert(!sent);
dhcpv6_packet_free(pkt);
+ free(conf_dns.addr);
+ memset(&conf_dns, 0, sizeof(conf_dns));
+
+ /* Domain-list options cannot be shortened; exhaustion drops the reply. */
+ conf_dnssl = domain;
+ conf_dnssl_size = sizeof(domain);
+ for (i = 0; i < sizeof(oro); i += 2)
+ u_write_be16(oro + i, D6_OPTION_DOMAIN_LIST);
+ len = request(buf);
+ len += option(buf + len, D6_OPTION_ORO, oro, sizeof(oro));
+ pkt = dhcpv6_packet_parse(buf, len);
+ assert(pkt);
+ pkt->ses = &ses;
+ sent = 0;
+ dhcpv6_send_reply(pkt, &pd, D6_REPLY);
+ assert(!sent);
+ dhcpv6_send_reply2(pkt, &pd, D6_REPLY);
+ assert(!sent);
+ dhcpv6_packet_free(pkt);
puts("DHCPv6 safeguards: PASS");
return 0;
}
diff --git a/tests/unit/run_safeguards.sh b/tests/unit/run_safeguards.sh
index 7f18c492..001cd19e 100644
--- a/tests/unit/run_safeguards.sh
+++ b/tests/unit/run_safeguards.sh
@@ -13,11 +13,15 @@ for name in $names; do
# LCP's global layer table retains the whole daemon under ASan; its test
# checks wire lengths with UBSan. The packet/VRF tests also use ASan.
if [ "$name" = lcp ]; then extra=-fno-sanitize=address; fi
+ set -- "tests/unit/${name}_safeguards_test.c"
+ if [ "$name" = dhcpv6 ]; then
+ set -- "$@" accel-pppd/ipv6_dns.c
+ fi
${CC:-cc} -O1 -g -Wall -Wno-unused-function -Wno-unused-result -D_GNU_SOURCE -DAP_SESSIONID_LEN=16 \
-DOPENSSL_API_COMPAT=0x10100000L -fno-strict-aliasing \
-ffunction-sections -fdata-sections -Wl,--gc-sections \
-fsanitize=address,undefined -fno-sanitize-recover=all $extra \
-I "$build" -I accel-pppd -I accel-pppd/include -I accel-pppd/triton \
- -o "$out/$name" "tests/unit/${name}_safeguards_test.c" -lcrypto -lpthread
+ -o "$out/$name" "$@" -lcrypto -lpthread
"$out/$name"
done