Skip to content

Commit 46c1b8d

Browse files
eamonjdfxlb
authored andcommitted
DHCPv6: client-id/server-id DUID type 2 correction
Explicitly print the enterprise as it is a separate field per RFC8415, and allow variable lengths. Add a test file.
1 parent 34a534f commit 46c1b8d

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

print-dhcp6.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ dhcp6opt_print(netdissect_options *ndo,
336336
}
337337
break;
338338
case 2:
339-
if (optlen >= 2 + 8) {
340-
ND_PRINT(" vid ");
341-
for (i = 2; i < 2 + 8; i++)
339+
if (optlen >= 2 + 4) {
340+
ND_PRINT(" enterprise %u ", GET_BE_U_4(tp + 2));
341+
for (i = 2 + 4; i < optlen; i++)
342342
ND_PRINT("%02x",
343343
GET_U_1(tp + i));
344344
/*(*/

tests/TESTLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ various_gre various_gre.pcap various_gre.out -v
911911

912912
# DHCP ZTP(RFC5970) and SZTP(RFC8572) tests
913913
dhcpv4v6-rfc5970-rfc8572 dhcpv4v6-rfc5970-rfc8572.pcap dhcpv4v6-rfc5970-rfc8572.out -vv
914+
dhcpv6-rfc8415-duid-type2 dhcpv6-rfc8415-duid-type2.pcap dhcpv6-rfc8415-duid-type2.out -v
914915

915916
# NHRP tests
916917
ios_nhrp ios_nhrp.pcap ios_nhrp.out -v

tests/dhcpv6-rfc8415-duid-type2.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 16:59:07.188393 IP6 (flowlabel 0x38898, hlim 1, next-header UDP (17) payload length: 155) fe80::200:1ff:fe01:0.546 > ff02::1:2.547: [udp sum ok] dhcp6 request (xid=e4a4a3 (vendor-specific-info) (client-ID enterprise 30065 4853483134343235313438) (server-ID hwaddr/time type 1 time 721155524 828662a1defd) (option-request Bootfile-URL SZTP-redirect DNS-search-list DNS-server) (elapsed-time 0) (user-class Arista) (IA_NA IAID:16842752 T1:3600 T2:5400 (IA_ADDR 1234:5678::4 pltime:7200 vltime:7500)))

tests/dhcpv6-rfc8415-duid-type2.pcap

249 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)