case DH6OPT_SIP_SERVER_D:
case DH6OPT_DOMAIN_LIST:
tp = (u_char *)(dh6o + 1);
- while (tp < ep) {
+ while (tp < cp + sizeof(*dh6o) + optlen) {
putchar(' ');
- if((tp = ns_nprint(tp, ep)) == NULL)
+ if ((tp = ns_nprint(tp, cp + sizeof(*dh6o) + optlen)) == NULL)
goto trunc;
}
+ printf(")");
break;
case DH6OPT_STATUS_CODE:
if (optlen < 2) {
break;
}
tp = (u_char *)(dh6o + 1);
- while (tp < ep - 4) {
+ while (tp < cp + sizeof(*dh6o) + optlen - 4) {
subopt_code = EXTRACT_16BITS(tp);
tp += 2;
subopt_len = EXTRACT_16BITS(tp);
tp += 2;
+ if (tp + subopt_len > cp + sizeof(*dh6o) + optlen)
+ goto trunc;
printf(" subopt:%d", subopt_code);
switch (subopt_code) {
case DH6OPT_NTP_SUBOPTION_SRV_ADDR:
break;
}
printf(" %s", ip6addr_string(&tp[0]));
- tp += subopt_len;
break;
case DH6OPT_NTP_SUBOPTION_SRV_FQDN:
putchar(' ');
- ns_nprint(tp, ep);
- tp += subopt_len;
+ if (ns_nprint(tp, tp + subopt_len) == NULL)
+ goto trunc;
break;
default:
printf(" ?");
break;
}
+ tp += subopt_len;
}
printf(")");
break;
-IP6 (hlim 64, next-header UDP (17) payload length: 101) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=aa56ce (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (DNS-search-list example.com. sales.example.com. eng.example.com.)
+IP6 (hlim 64, next-header UDP (17) payload length: 101) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=aa56ce (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (DNS-search-list example.com. sales.example.com. eng.example.com.))
-IP6 (hlim 64, next-header UDP (17) payload length: 114) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=6890d8 (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (SIP-servers-domain sip1.my-domain.net. sip2.example.com. sip3.sub.my-domain.org.)
+IP6 (hlim 64, next-header UDP (17) payload length: 114) fe80::20c:29ff:fe9b:a15d.547 > fe80::20c:29ff:fe38:f368.546: [udp sum ok] dhcp6 reply (xid=6890d8 (client-ID hwaddr/time type 1 time 418384703 000c2938f368) (server-ID hwaddr/time type 1 time 418354459 000c299ba153) (SIP-servers-domain sip1.my-domain.net. sip2.example.com. sip3.sub.my-domain.org.))