aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dhcp
diff options
context:
space:
mode:
authorTom Jones <thj@freebsd.org>2024-01-31 09:13:44 +0000
committerDamjan Marion <dmarion@0xa5.net>2024-02-29 14:57:45 +0000
commit46bddc3b4a2c592b056a45c6a2b2f71e7f84fb6d (patch)
tree3be6e0c380786f39d5764431f4f8c8a9e8d098a0 /src/plugins/dhcp
parent3d1459b142d16a74a79576ed4c18f8c1ac14ed47 (diff)
dhcp: Compare DIUD_LL as a network short
The existing comparision triggers the following clang assertion: error: result of comparison of constant 50331648 with expression of type 'u16' (aka 'unsigned short') is always true Section 9.1 of RFC3315 describes the DUID type field as: "A DUID consists of a two-octet type code represented in network byte" correctly convert the local type to a network short for the comparison. Type: fix Change-Id: I7cb048035bd5e06372e29471ae6004ee1b2191b9 Signed-off-by: Tom Jones <thj@freebsd.org>
Diffstat (limited to 'src/plugins/dhcp')
-rw-r--r--src/plugins/dhcp/dhcp_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/dhcp/dhcp_api.c b/src/plugins/dhcp/dhcp_api.c
index 19457a73358..20b00422a73 100644
--- a/src/plugins/dhcp/dhcp_api.c
+++ b/src/plugins/dhcp/dhcp_api.c
@@ -92,7 +92,7 @@ vl_api_dhcp6_duid_ll_set_t_handler (vl_api_dhcp6_duid_ll_set_t * mp)
int rv = 0;
duid = (dhcpv6_duid_ll_string_t *) mp->duid_ll;
- if (duid->duid_type != htonl (DHCPV6_DUID_LL))
+ if (duid->duid_type != htons (DHCPV6_DUID_LL))
{
rv = VNET_API_ERROR_INVALID_VALUE;
goto reply;