From 72fa19239d8e11d993ea9a73b129b0bd6deaf736 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 9 Dec 2021 07:01:47 +0900 Subject: [PATCH] network: route: mask lower bits of destination or source prefix Let's gracefully handle user's misconfiguration, e.g. Destination=192.168.0.1/24 --- src/network/networkd-route.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 0693cbdee4..d791c4d044 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -2124,6 +2124,8 @@ int config_parse_destination( return 0; } + (void) in_addr_mask(n->family, buffer, *prefixlen); + TAKE_PTR(n); return 0; }