2 * Copyright (C) 1998 and 1999 WIDE Project.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the project nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * supported DHCPv6 options:
32 * RFC3319: Session Initiation Protocol (SIP) Servers options,
33 * RFC3633: IPv6 Prefix options,
34 * RFC3646: DNS Configuration options,
35 * RFC3898: Network Information Service (NIS) Configuration options,
36 * RFC4075: Simple Network Time Protocol (SNTP) Configuration option,
37 * RFC4242: Information Refresh Time option,
38 * RFC4280: Broadcast and Multicast Control Servers options,
39 * RFC5908: Network Time Protocol (NTP) Server Option for DHCPv6
40 * RFC6334: Dual-Stack Lite option,
44 static const char rcsid
[] _U_
=
45 "@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.37 2008-02-06 10:26:09 guy Exp $";
52 #include <tcpdump-stdinc.h>
57 #include "interface.h"
58 #include "addrtoname.h"
62 #define DHCP6_DURATITION_INFINITE 0xffffffff
65 #define DH6ERR_FAILURE 16
66 #define DH6ERR_AUTHFAIL 17
67 #define DH6ERR_POORLYFORMED 18
68 #define DH6ERR_UNAVAIL 19
69 #define DH6ERR_OPTUNAVAIL 20
73 #define DH6_ADVERTISE 2
81 #define DH6_RECONFIGURE 10
82 #define DH6_INFORM_REQ 11
83 #define DH6_RELAY_FORW 12
84 #define DH6_RELAY_REPLY 13
85 #define DH6_LEASEQUERY 14
86 #define DH6_LQ_REPLY 15
88 /* DHCP6 base packet format */
96 #define dh6_msgtype dh6_msgtypexid.m
97 #define dh6_xid dh6_msgtypexid.x
98 #define DH6_XIDMASK 0x00ffffff
100 /* DHCPv6 relay messages */
102 u_int8_t dh6relay_msgtype
;
103 u_int8_t dh6relay_hcnt
;
104 u_int8_t dh6relay_linkaddr
[16]; /* XXX: badly aligned */
105 u_int8_t dh6relay_peeraddr
[16];
110 #define DH6OPT_CLIENTID 1
111 #define DH6OPT_SERVERID 2
112 #define DH6OPT_IA_NA 3
113 #define DH6OPT_IA_TA 4
114 #define DH6OPT_IA_ADDR 5
116 #define DH6OPT_PREFERENCE 7
117 # define DH6OPT_PREF_MAX 255
118 #define DH6OPT_ELAPSED_TIME 8
119 #define DH6OPT_RELAY_MSG 9
120 /*#define DH6OPT_SERVER_MSG 10 deprecated */
121 #define DH6OPT_AUTH 11
122 # define DH6OPT_AUTHPROTO_DELAYED 2
123 # define DH6OPT_AUTHPROTO_RECONFIG 3
124 # define DH6OPT_AUTHALG_HMACMD5 1
125 # define DH6OPT_AUTHRDM_MONOCOUNTER 0
126 # define DH6OPT_AUTHRECONFIG_KEY 1
127 # define DH6OPT_AUTHRECONFIG_HMACMD5 2
128 #define DH6OPT_UNICAST 12
129 #define DH6OPT_STATUS_CODE 13
130 # define DH6OPT_STCODE_SUCCESS 0
131 # define DH6OPT_STCODE_UNSPECFAIL 1
132 # define DH6OPT_STCODE_NOADDRAVAIL 2
133 # define DH6OPT_STCODE_NOBINDING 3
134 # define DH6OPT_STCODE_NOTONLINK 4
135 # define DH6OPT_STCODE_USEMULTICAST 5
136 # define DH6OPT_STCODE_NOPREFIXAVAIL 6
137 # define DH6OPT_STCODE_UNKNOWNQUERYTYPE 7
138 # define DH6OPT_STCODE_MALFORMEDQUERY 8
139 # define DH6OPT_STCODE_NOTCONFIGURED 9
140 # define DH6OPT_STCODE_NOTALLOWED 10
141 #define DH6OPT_RAPID_COMMIT 14
142 #define DH6OPT_USER_CLASS 15
143 #define DH6OPT_VENDOR_CLASS 16
144 #define DH6OPT_VENDOR_OPTS 17
145 #define DH6OPT_INTERFACE_ID 18
146 #define DH6OPT_RECONF_MSG 19
147 #define DH6OPT_RECONF_ACCEPT 20
148 #define DH6OPT_SIP_SERVER_D 21
149 #define DH6OPT_SIP_SERVER_A 22
150 #define DH6OPT_DNS_SERVERS 23
151 #define DH6OPT_DOMAIN_LIST 24
152 #define DH6OPT_IA_PD 25
153 #define DH6OPT_IA_PD_PREFIX 26
154 #define DH6OPT_NIS_SERVERS 27
155 #define DH6OPT_NISP_SERVERS 28
156 #define DH6OPT_NIS_NAME 29
157 #define DH6OPT_NISP_NAME 30
158 #define DH6OPT_SNTP_SERVERS 31
159 #define DH6OPT_LIFETIME 32
160 #define DH6OPT_BCMCS_SERVER_D 33
161 #define DH6OPT_BCMCS_SERVER_A 34
162 #define DH6OPT_GEOCONF_CIVIC 36
163 #define DH6OPT_REMOTE_ID 37
164 #define DH6OPT_SUBSCRIBER_ID 38
165 #define DH6OPT_CLIENT_FQDN 39
166 #define DH6OPT_PANA_AGENT 40
167 #define DH6OPT_NEW_POSIX_TIMEZONE 41
168 #define DH6OPT_NEW_TZDB_TIMEZONE 42
169 #define DH6OPT_ERO 43
170 #define DH6OPT_LQ_QUERY 44
171 #define DH6OPT_CLIENT_DATA 45
172 #define DH6OPT_CLT_TIME 46
173 #define DH6OPT_LQ_RELAY_DATA 47
174 #define DH6OPT_LQ_CLIENT_LINK 48
175 #define DH6OPT_NTP_SERVER 56
176 # define DH6OPT_NTP_SUBOPTION_SRV_ADDR 1
177 # define DH6OPT_NTP_SUBOPTION_MC_ADDR 2
178 # define DH6OPT_NTP_SUBOPTION_SRV_FQDN 3
179 #define DH6OPT_AFTR_NAME 64
182 u_int16_t dh6opt_type
;
183 u_int16_t dh6opt_len
;
184 /* type-dependent data follows */
188 dhcp6opt_name(int type
)
190 static char genstr
[sizeof("opt_65535") + 1]; /* XXX thread unsafe */
193 return "INVALID-option";
196 case DH6OPT_CLIENTID
:
198 case DH6OPT_SERVERID
:
207 return "option-request";
208 case DH6OPT_PREFERENCE
:
210 case DH6OPT_ELAPSED_TIME
:
211 return "elapsed-time";
212 case DH6OPT_RELAY_MSG
:
213 return "relay-message";
215 return "authentication";
217 return "server-unicast";
218 case DH6OPT_STATUS_CODE
:
219 return "status-code";
220 case DH6OPT_RAPID_COMMIT
:
221 return "rapid-commit";
222 case DH6OPT_USER_CLASS
:
224 case DH6OPT_VENDOR_CLASS
:
225 return "vendor-class";
226 case DH6OPT_VENDOR_OPTS
:
227 return "vendor-specific-info";
228 case DH6OPT_INTERFACE_ID
:
229 return "interface-ID";
230 case DH6OPT_RECONF_MSG
:
231 return "reconfigure-message";
232 case DH6OPT_RECONF_ACCEPT
:
233 return "reconfigure-accept";
234 case DH6OPT_SIP_SERVER_D
:
235 return "SIP-servers-domain";
236 case DH6OPT_SIP_SERVER_A
:
237 return "SIP-servers-address";
238 case DH6OPT_DNS_SERVERS
:
240 case DH6OPT_DOMAIN_LIST
:
241 return "DNS-search-list";
244 case DH6OPT_IA_PD_PREFIX
:
245 return "IA_PD-prefix";
246 case DH6OPT_SNTP_SERVERS
:
247 return "SNTP-servers";
248 case DH6OPT_LIFETIME
:
250 case DH6OPT_NIS_SERVERS
:
252 case DH6OPT_NISP_SERVERS
:
253 return "NIS+-server";
254 case DH6OPT_NIS_NAME
:
255 return "NIS-domain-name";
256 case DH6OPT_NISP_NAME
:
257 return "NIS+-domain-name";
258 case DH6OPT_BCMCS_SERVER_D
:
259 return "BCMCS-domain-name";
260 case DH6OPT_BCMCS_SERVER_A
:
261 return "BCMCS-server";
262 case DH6OPT_GEOCONF_CIVIC
:
263 return "Geoconf-Civic";
264 case DH6OPT_REMOTE_ID
:
266 case DH6OPT_SUBSCRIBER_ID
:
267 return "Subscriber-ID";
268 case DH6OPT_CLIENT_FQDN
:
269 return "Client-FQDN";
270 case DH6OPT_PANA_AGENT
:
272 case DH6OPT_NEW_POSIX_TIMEZONE
:
273 return "POSIX-timezone";
274 case DH6OPT_NEW_TZDB_TIMEZONE
:
275 return "POSIX-tz-database";
277 return "Echo-request-option";
278 case DH6OPT_LQ_QUERY
:
279 return "Lease-query";
280 case DH6OPT_CLIENT_DATA
:
281 return "LQ-client-data";
282 case DH6OPT_CLT_TIME
:
284 case DH6OPT_LQ_RELAY_DATA
:
285 return "LQ-relay-data";
286 case DH6OPT_LQ_CLIENT_LINK
:
287 return "LQ-client-link";
288 case DH6OPT_NTP_SERVER
:
290 case DH6OPT_AFTR_NAME
:
293 snprintf(genstr
, sizeof(genstr
), "opt_%d", type
);
299 dhcp6stcode(int code
)
301 static char genstr
[sizeof("code255") + 1]; /* XXX thread unsafe */
304 return "INVALID code";
307 case DH6OPT_STCODE_SUCCESS
:
309 case DH6OPT_STCODE_UNSPECFAIL
:
310 return "unspec failure";
311 case DH6OPT_STCODE_NOADDRAVAIL
:
312 return "no addresses";
313 case DH6OPT_STCODE_NOBINDING
:
315 case DH6OPT_STCODE_NOTONLINK
:
316 return "not on-link";
317 case DH6OPT_STCODE_USEMULTICAST
:
318 return "use multicast";
319 case DH6OPT_STCODE_NOPREFIXAVAIL
:
320 return "no prefixes";
321 case DH6OPT_STCODE_UNKNOWNQUERYTYPE
:
322 return "unknown query type";
323 case DH6OPT_STCODE_MALFORMEDQUERY
:
324 return "malformed query";
325 case DH6OPT_STCODE_NOTCONFIGURED
:
326 return "not configured";
327 case DH6OPT_STCODE_NOTALLOWED
:
328 return "not allowed";
330 snprintf(genstr
, sizeof(genstr
), "code%d", code
);
336 dhcp6opt_print(const u_char
*cp
, const u_char
*ep
)
338 const struct dhcp6opt
*dh6o
;
344 u_int authinfolen
, authrealmlen
;
345 int remain_len
; /* Length of remaining options */
346 int label_len
; /* Label length */
347 u_int16_t subopt_code
;
348 u_int16_t subopt_len
;
353 if (ep
< cp
+ sizeof(*dh6o
))
355 dh6o
= (struct dhcp6opt
*)cp
;
357 optlen
= EXTRACT_16BITS(&dh6o
->dh6opt_len
);
358 if (ep
< cp
+ sizeof(*dh6o
) + optlen
)
360 opttype
= EXTRACT_16BITS(&dh6o
->dh6opt_type
);
361 printf(" (%s", dhcp6opt_name(opttype
));
363 case DH6OPT_CLIENTID
:
364 case DH6OPT_SERVERID
:
370 tp
= (u_char
*)(dh6o
+ 1);
371 switch (EXTRACT_16BITS(tp
)) {
373 if (optlen
>= 2 + 6) {
374 printf(" hwaddr/time type %u time %u ",
375 EXTRACT_16BITS(&tp
[2]),
376 EXTRACT_32BITS(&tp
[4]));
377 for (i
= 8; i
< optlen
; i
++)
378 printf("%02x", tp
[i
]);
387 if (optlen
>= 2 + 8) {
389 for (i
= 2; i
< 2 + 8; i
++)
390 printf("%02x", tp
[i
]);
399 if (optlen
>= 2 + 2) {
400 printf(" hwaddr type %u ",
401 EXTRACT_16BITS(&tp
[2]));
402 for (i
= 4; i
< optlen
; i
++)
403 printf("%02x", tp
[i
]);
412 printf(" type %d)", EXTRACT_16BITS(tp
));
422 tp
= (u_char
*)(dh6o
+ 1);
423 printf(" %s", ip6addr_string(&tp
[0]));
424 printf(" pltime:%u vltime:%u",
425 EXTRACT_32BITS(&tp
[16]),
426 EXTRACT_32BITS(&tp
[20]));
428 /* there are sub-options */
429 dhcp6opt_print(tp
+ 24, tp
+ optlen
);
439 tp
= (u_char
*)(dh6o
+ 1);
440 for (i
= 0; i
< optlen
; i
+= 2) {
442 dhcp6opt_name(EXTRACT_16BITS(&tp
[i
])));
446 case DH6OPT_PREFERENCE
:
451 tp
= (u_char
*)(dh6o
+ 1);
454 case DH6OPT_ELAPSED_TIME
:
459 tp
= (u_char
*)(dh6o
+ 1);
460 printf(" %d)", EXTRACT_16BITS(tp
));
462 case DH6OPT_RELAY_MSG
:
464 tp
= (u_char
*)(dh6o
+ 1);
465 dhcp6_print(tp
, optlen
);
473 tp
= (u_char
*)(dh6o
+ 1);
475 switch (auth_proto
) {
476 case DH6OPT_AUTHPROTO_DELAYED
:
477 printf(" proto: delayed");
479 case DH6OPT_AUTHPROTO_RECONFIG
:
480 printf(" proto: reconfigure");
483 printf(" proto: %d", auth_proto
);
488 case DH6OPT_AUTHALG_HMACMD5
:
489 /* XXX: may depend on the protocol */
490 printf(", alg: HMAC-MD5");
493 printf(", alg: %d", *tp
);
498 case DH6OPT_AUTHRDM_MONOCOUNTER
:
499 printf(", RDM: mono");
502 printf(", RDM: %d", *tp
);
507 for (i
= 0; i
< 4; i
++, tp
+= 2)
508 printf(" %04x", EXTRACT_16BITS(tp
));
510 /* protocol dependent part */
511 authinfolen
= optlen
- 11;
512 switch (auth_proto
) {
513 case DH6OPT_AUTHPROTO_DELAYED
:
514 if (authinfolen
== 0)
516 if (authinfolen
< 20) {
520 authrealmlen
= authinfolen
- 20;
521 if (authrealmlen
> 0) {
524 for (i
= 0; i
< authrealmlen
; i
++, tp
++)
526 printf(", key ID: %08x", EXTRACT_32BITS(tp
));
528 printf(", HMAC-MD5:");
529 for (i
= 0; i
< 4; i
++, tp
+= 4)
530 printf(" %08x", EXTRACT_32BITS(tp
));
532 case DH6OPT_AUTHPROTO_RECONFIG
:
533 if (authinfolen
!= 17) {
538 case DH6OPT_AUTHRECONFIG_KEY
:
539 printf(" reconfig-key");
541 case DH6OPT_AUTHRECONFIG_HMACMD5
:
542 printf(" type: HMAC-MD5");
549 for (i
= 0; i
< 4; i
++, tp
+= 4)
550 printf(" %08x", EXTRACT_32BITS(tp
));
559 case DH6OPT_RAPID_COMMIT
: /* nothing todo */
562 case DH6OPT_INTERFACE_ID
:
563 case DH6OPT_SUBSCRIBER_ID
:
565 * Since we cannot predict the encoding, print hex dump
566 * at most 10 characters.
568 tp
= (u_char
*)(dh6o
+ 1);
570 for (i
= 0; i
< optlen
&& i
< 10; i
++)
571 printf("%02x", tp
[i
]);
574 case DH6OPT_RECONF_MSG
:
575 tp
= (u_char
*)(dh6o
+ 1);
578 printf(" for renew)");
581 printf(" for inf-req)");
584 printf(" for ?\?\?(%02x))", *tp
);
588 case DH6OPT_RECONF_ACCEPT
: /* nothing todo */
591 case DH6OPT_SIP_SERVER_A
:
592 case DH6OPT_DNS_SERVERS
:
593 case DH6OPT_SNTP_SERVERS
:
594 case DH6OPT_NIS_SERVERS
:
595 case DH6OPT_NISP_SERVERS
:
596 case DH6OPT_BCMCS_SERVER_A
:
597 case DH6OPT_PANA_AGENT
:
598 case DH6OPT_LQ_CLIENT_LINK
:
603 tp
= (u_char
*)(dh6o
+ 1);
604 for (i
= 0; i
< optlen
; i
+= 16)
605 printf(" %s", ip6addr_string(&tp
[i
]));
608 case DH6OPT_SIP_SERVER_D
:
609 case DH6OPT_DOMAIN_LIST
:
610 tp
= (u_char
*)(dh6o
+ 1);
611 while (tp
< cp
+ sizeof(*dh6o
) + optlen
) {
613 if ((tp
= ns_nprint(tp
, cp
+ sizeof(*dh6o
) + optlen
)) == NULL
)
618 case DH6OPT_STATUS_CODE
:
623 tp
= (u_char
*)(dh6o
+ 1);
624 printf(" %s)", dhcp6stcode(EXTRACT_16BITS(&tp
[0])));
632 tp
= (u_char
*)(dh6o
+ 1);
633 printf(" IAID:%u T1:%u T2:%u",
634 EXTRACT_32BITS(&tp
[0]),
635 EXTRACT_32BITS(&tp
[4]),
636 EXTRACT_32BITS(&tp
[8]));
638 /* there are sub-options */
639 dhcp6opt_print(tp
+ 12, tp
+ optlen
);
648 tp
= (u_char
*)(dh6o
+ 1);
649 printf(" IAID:%u", EXTRACT_32BITS(tp
));
651 /* there are sub-options */
652 dhcp6opt_print(tp
+ 4, tp
+ optlen
);
656 case DH6OPT_IA_PD_PREFIX
:
661 tp
= (u_char
*)(dh6o
+ 1);
662 printf(" %s/%d", ip6addr_string(&tp
[9]), tp
[8]);
663 printf(" pltime:%u vltime:%u",
664 EXTRACT_32BITS(&tp
[0]),
665 EXTRACT_32BITS(&tp
[4]));
667 /* there are sub-options */
668 dhcp6opt_print(tp
+ 25, tp
+ optlen
);
672 case DH6OPT_LIFETIME
:
673 case DH6OPT_CLT_TIME
:
678 tp
= (u_char
*)(dh6o
+ 1);
679 printf(" %d)", EXTRACT_32BITS(tp
));
681 case DH6OPT_REMOTE_ID
:
686 tp
= (u_char
*)(dh6o
+ 1);
687 printf(" %d ", EXTRACT_32BITS(tp
));
689 * Print hex dump first 10 characters.
691 for (i
= 4; i
< optlen
&& i
< 14; i
++)
692 printf("%02x", tp
[i
]);
695 case DH6OPT_LQ_QUERY
:
700 tp
= (u_char
*)(dh6o
+ 1);
703 printf(" by-address");
706 printf(" by-clientID");
709 printf(" type_%d", (int)*tp
);
712 printf(" %s", ip6addr_string(&tp
[1]));
714 /* there are query-options */
715 dhcp6opt_print(tp
+ 17, tp
+ optlen
);
719 case DH6OPT_CLIENT_DATA
:
720 tp
= (u_char
*)(dh6o
+ 1);
722 /* there are encapsulated options */
723 dhcp6opt_print(tp
, tp
+ optlen
);
727 case DH6OPT_LQ_RELAY_DATA
:
732 tp
= (u_char
*)(dh6o
+ 1);
733 printf(" %s ", ip6addr_string(&tp
[0]));
735 * Print hex dump first 10 characters.
737 for (i
= 16; i
< optlen
&& i
< 26; i
++)
738 printf("%02x", tp
[i
]);
741 case DH6OPT_NTP_SERVER
:
746 tp
= (u_char
*)(dh6o
+ 1);
747 while (tp
< cp
+ sizeof(*dh6o
) + optlen
- 4) {
748 subopt_code
= EXTRACT_16BITS(tp
);
750 subopt_len
= EXTRACT_16BITS(tp
);
752 if (tp
+ subopt_len
> cp
+ sizeof(*dh6o
) + optlen
)
754 printf(" subopt:%d", subopt_code
);
755 switch (subopt_code
) {
756 case DH6OPT_NTP_SUBOPTION_SRV_ADDR
:
757 case DH6OPT_NTP_SUBOPTION_MC_ADDR
:
758 if (subopt_len
!= 16) {
762 printf(" %s", ip6addr_string(&tp
[0]));
764 case DH6OPT_NTP_SUBOPTION_SRV_FQDN
:
766 if (ns_nprint(tp
, tp
+ subopt_len
) == NULL
)
777 case DH6OPT_AFTR_NAME
:
782 tp
= (u_char
*)(dh6o
+ 1);
785 /* Encoding is described in section 3.1 of RFC 1035 */
786 while (remain_len
&& *tp
) {
788 if (label_len
< remain_len
- 1) {
789 printf("%.*s", label_len
, tp
);
791 remain_len
-= (label_len
+ 1);
805 cp
+= sizeof(*dh6o
) + optlen
;
810 printf("[|dhcp6ext]");
814 * Print dhcp6 packets
817 dhcp6_print(const u_char
*cp
, u_int length
)
820 struct dhcp6_relay
*dh6relay
;
827 ep
= (u_char
*)snapend
;
828 if (cp
+ length
< ep
)
831 dh6
= (struct dhcp6
*)cp
;
832 dh6relay
= (struct dhcp6_relay
*)cp
;
833 TCHECK(dh6
->dh6_xid
);
834 switch (dh6
->dh6_msgtype
) {
862 case DH6_RECONFIGURE
:
863 name
= "reconfigure";
871 case DH6_RELAY_REPLY
:
878 name
= "leasequery-reply";
888 else if (dh6
->dh6_msgtype
!= DH6_RELAY_FORW
&&
889 dh6
->dh6_msgtype
!= DH6_RELAY_REPLY
) {
890 printf(" msgtype-%u", dh6
->dh6_msgtype
);
895 /* XXX relay agent messages have to be handled differently */
898 printf(" %s (", name
); /*)*/
900 printf(" msgtype-%u (", dh6
->dh6_msgtype
); /*)*/
901 if (dh6
->dh6_msgtype
!= DH6_RELAY_FORW
&&
902 dh6
->dh6_msgtype
!= DH6_RELAY_REPLY
) {
903 printf("xid=%x", EXTRACT_32BITS(&dh6
->dh6_xid
) & DH6_XIDMASK
);
904 extp
= (u_char
*)(dh6
+ 1);
905 dhcp6opt_print(extp
, ep
);
906 } else { /* relay messages */
907 struct in6_addr addr6
;
909 TCHECK(dh6relay
->dh6relay_peeraddr
);
911 memcpy(&addr6
, dh6relay
->dh6relay_linkaddr
, sizeof (addr6
));
912 printf("linkaddr=%s", ip6addr_string(&addr6
));
914 memcpy(&addr6
, dh6relay
->dh6relay_peeraddr
, sizeof (addr6
));
915 printf(" peeraddr=%s", ip6addr_string(&addr6
));
917 dhcp6opt_print((u_char
*)(dh6relay
+ 1), ep
);