Showing with 19 additions and 5 deletions.
  1. +19 −5 dhcp6c_ia.c
24 changes: 19 additions & 5 deletions dhcp6c_ia.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ update_ia(iatype_t iatype, struct dhcp6_list *ialist, struct dhcp6_if *ifp,
}
break;
case DHCP6_LISTVAL_STCODE:
d_printf(LOG_INFO, FNAME,
"status code for %s-%lu: %s",
iastr(iatype), iav->val_ia.iaid,
dhcp6_stcodestr(siav->val_num16));
if ((ia->state == IAS_RENEW ||
ia->state == IAS_REBIND)) {
if (siav->val_num16 == DH6OPT_STCODE_NOBINDING) {
Expand All @@ -184,7 +180,7 @@ update_ia(iatype_t iatype, struct dhcp6_list *ialist, struct dhcp6_if *ifp,
* XXX: what about the PD case?
*/
d_printf(LOG_NOTICE, FNAME,
"receive NoBinding for %s-%lu",
"received NoBinding for %s-%lu",
iastr(ia->conf->type),
ia->conf->iaid);
reestablish_ia(ia);
Expand All @@ -202,8 +198,26 @@ update_ia(iatype_t iatype, struct dhcp6_list *ialist, struct dhcp6_if *ifp,
ia->conf->iaid);
remove_ia(ia, 1);
goto nextia;
} else if (siav->val_num16 == DH6OPT_STCODE_NOADDRSAVAIL) {
/*
* Apparently there was no address since
* we got NoAddrAvail in the status code,
* but it may have looked like one and we
* would end up invalidating it immediately
* breaking the flow of the lease acquire.
*/
d_printf(LOG_NOTICE, FNAME,
"received NoAddrAvail for %s-%lu",
iastr(ia->conf->type),
ia->conf->iaid);
remove_ia(ia, 1);
goto nextia;
}
}
d_printf(LOG_INFO, FNAME,
"unhandled status code for %s-%lu: %s",
iastr(iatype), iav->val_ia.iaid,
dhcp6_stcodestr(siav->val_num16));
break;
default:
d_printf(LOG_ERR, FNAME, "impossible case");
Expand Down