From: Zbigniew Jędrzejewski-Szmek Date: Fri, 22 Sep 2023 12:29:47 +0000 (+0200) Subject: Merge pull request #29224 from keszybz/netdev-config-parsing X-Git-Tag: v255-rc1~458 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0fe45a93fb6f71c2dad083653a515ce40c2f725;p=thirdparty%2Fsystemd.git Merge pull request #29224 from keszybz/netdev-config-parsing Use a helper to simplify parsing of ranges in netdev config and related changes --- a0fe45a93fb6f71c2dad083653a515ce40c2f725 diff --cc src/libsystemd-network/sd-radv.c index e77d4b4f596,9506759bb57..7da22c90c20 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@@ -1141,9 -1144,10 +1141,10 @@@ int sd_radv_pref64_prefix_set_prefix r = pref64_prefix_length_to_plc(prefixlen, &prefixlen_code); if (r < 0) - return log_radv_errno(NULL, r, "Unsupported PREF64 prefix length %u. Valid lengths are 32, 40, 48, 56, 64 and 96", prefixlen); + return log_radv_errno(NULL, r, + "Unsupported PREF64 prefix length %u. Valid lengths are 32, 40, 48, 56, 64 and 96", prefixlen); - if (lifetime_usec == USEC_INFINITY || DIV_ROUND_UP(lifetime_usec, 8 * USEC_PER_SEC) >= UINT64_C(1) << 13) + if (lifetime_usec > PREF64_MAX_LIFETIME_USEC) return -EINVAL; /* RFC 8781 - 4.1 rounding up lifetime to multiply of 8 */