The "type > 65535" condition in dhcp6opt_name() was always false because
the function is given a 16-bit argument.
The "dh6->dh6_msgtype" condition in dhcp6_print() was always true
because name == NULL only when none of the preceding switch block cases
matched.
{
static char genstr[sizeof("opt_65535") + 1]; /* XXX thread unsafe */
{
static char genstr[sizeof("opt_65535") + 1]; /* XXX thread unsafe */
- if (type > 65535)
- return "INVALID-option";
-
switch(type) {
case DH6OPT_CLIENTID:
return "client-ID";
switch(type) {
case DH6OPT_CLIENTID:
return "client-ID";
if (!ndo->ndo_vflag) {
if (name)
ND_PRINT((ndo, " %s", name));
if (!ndo->ndo_vflag) {
if (name)
ND_PRINT((ndo, " %s", name));
- else if (dh6->dh6_msgtype != DH6_RELAY_FORW &&
- dh6->dh6_msgtype != DH6_RELAY_REPLY) {
ND_PRINT((ndo, " msgtype-%u", dh6->dh6_msgtype));
ND_PRINT((ndo, " msgtype-%u", dh6->dh6_msgtype));