dhcp: Compare DIUD_LL as a network short 87/40387/2
authorTom Jones <thj@freebsd.org>
Wed, 31 Jan 2024 09:13:44 +0000 (09:13 +0000)
committerDamjan Marion <dmarion@0xa5.net>
Thu, 29 Feb 2024 14:57:45 +0000 (14:57 +0000)
commit46bddc3b4a2c592b056a45c6a2b2f71e7f84fb6d
tree3be6e0c380786f39d5764431f4f8c8a9e8d098a0
parent3d1459b142d16a74a79576ed4c18f8c1ac14ed47
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>
src/plugins/dhcp/dhcp_api.c