From: Susant Sahani Date: Tue, 19 May 2020 09:16:57 +0000 (+0200) Subject: DHCP: Use UINT8_MAX instead of 255 X-Git-Tag: v246-rc1~329^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffed0205c70531ef001ff3f580091f6f233afc5f;p=thirdparty%2Fsystemd.git DHCP: Use UINT8_MAX instead of 255 --- diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c index 71ee9554321..9ab0187d2d8 100644 --- a/src/network/networkd-dhcp-common.c +++ b/src/network/networkd-dhcp-common.c @@ -360,7 +360,7 @@ int config_parse_dhcp6_mud_url( return 0; } - if (!http_url_is_valid(unescaped) || strlen(unescaped) > 255) { + if (!http_url_is_valid(unescaped) || strlen(unescaped) > UINT8_MAX) { log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse MUD URL '%s', ignoring: %m", rvalue); @@ -435,7 +435,7 @@ int config_parse_dhcp_send_option( "Invalid DHCP option, ignoring assignment: %s", rvalue); return 0; } - if (u8 < 1 || u8 >= 255) { + if (u8 < 1 || u8 >= UINT8_MAX) { log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid DHCP option, valid range is 1-254, ignoring assignment: %s", rvalue); return 0; @@ -631,7 +631,7 @@ int config_parse_dhcp_request_options( continue; } - if (i < 1 || i >= 255) { + if (i < 1 || i >= UINT8_MAX) { log_syntax(unit, LOG_ERR, filename, line, r, "DHCP request option is invalid, valid range is 1-254, ignoring assignment: %s", n); continue;