Skip to content

Commit bb7462c

Browse files
ethan-thompsonalandekok
authored andcommitted
update checks for Server-Id
As per RFC 9915 the server MUST discard any Solicit, Confirm, or Rebind messages that include a Server Identifier option. Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
1 parent 3572cf8 commit bb7462c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/protocols/dhcpv6/base.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,8 @@ static bool verify_from_client(uint8_t const *packet, size_t packet_len, fr_dhcp
453453
return false;
454454
}
455455

456-
if (!fr_dhcpv6_option_find(options, end, FR_SERVER_ID)) {
457-
fail_sid:
458-
fr_strerror_const("Packet does not contain a Server-Id option");
456+
if (fr_dhcpv6_option_find(options, end, FR_SERVER_ID)) {
457+
fr_strerror_const("Packet contains a Server-Id option");
459458
return false;
460459
}
461460
break;
@@ -467,7 +466,10 @@ static bool verify_from_client(uint8_t const *packet, size_t packet_len, fr_dhcp
467466
if (!fr_dhcpv6_option_find(options, end, FR_CLIENT_ID)) goto fail_cid;
468467

469468
option = fr_dhcpv6_option_find(options, end, FR_SERVER_ID);
470-
if (!option) goto fail_sid;
469+
if (!option) {
470+
fr_strerror_const("Packet does not contain a Server-Id option");
471+
return false;
472+
}
471473

472474
if (!duid_match(option, packet_ctx)) {
473475
fail_match:

0 commit comments

Comments
 (0)