summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-28 22:42:03 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-04 16:18:07 +0100
commit1690672140f994bdce7c07ba26c372890f85060d (patch)
tree0d12d5f4e45e47c022ef6fd588f0e4df470ea132
parent2a9efd85136e468f09d7fcccd494774f82ff005b (diff)
downloadsystemd-1690672140f994bdce7c07ba26c372890f85060d.tar.gz
network: ndisc: ignore route prefix to ::/0
Fixes #21912. (cherry picked from commit 80bfc3b901317ca7c1aaede0cd69150789a6e9be)
-rw-r--r--src/network/networkd-ndisc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index 32cb536ee5..f616f2c9bc 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -612,6 +612,11 @@ static int ndisc_router_process_route(Link *link, sd_ndisc_router *rt) {
if (r < 0)
return log_link_error_errno(link, r, "Failed to get route prefix length: %m");
+ if (in6_addr_is_null(&dst) && prefixlen == 0) {
+ log_link_debug(link, "Route prefix is ::/0, ignoring");
+ return 0;
+ }
+
if (in6_prefix_is_filtered(&dst, prefixlen, link->network->ndisc_allow_listed_route_prefix, link->network->ndisc_deny_listed_route_prefix)) {
if (DEBUG_LOGGING) {
_cleanup_free_ char *buf = NULL;