File tree 1 file changed +27
-5
lines changed 1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -724,17 +724,39 @@ dhcp_time_t dhcp_iapd_step(struct dhcp_iapd *iapd, struct dhcp_context *ctx)
724
724
725
725
static void handle_iaprefix_noprefixavail (struct dhcp_iapd * iapd )
726
726
{
727
- if (iapd -> state != IAPD_STATE_REQUEST )
727
+ enum iapd_prefix_selection sel ;
728
+
729
+ switch (iapd -> state ) {
730
+ case IAPD_STATE_REQUEST :
731
+ sel = IAPD_PREFIX_SEL_PENDING ;
732
+ break ;
733
+
734
+ case IAPD_STATE_RENEW :
735
+ /* on no-prefix-available during RENEW, reset lifetimes which
736
+ will trigger the condition in check #3 */
737
+ sel = IAPD_PREFIX_SEL_ACTIVE ;
738
+ break ;
739
+
740
+ default :
728
741
return ;
742
+ }
729
743
730
744
for (size_t i = 0 ; i < ARRAY_SIZE (iapd -> iaprefix ); ++ i ) {
731
- struct dhcp_iaprefix * tmp = & iapd -> iaprefix [ i ]. pending ;
745
+ struct dhcp_iaprefix * tmp = get_iaprefix ( iapd , i , sel ) ;
732
746
733
- tmp -> net .len = 0 ;
734
- tmp -> lease_tm = TIME_EPOCH ;
735
747
tmp -> pref_lt = 0 ;
736
748
tmp -> valid_lt = 0 ;
737
- memset (& tmp -> net .prefix , 0 , sizeof tmp -> net .prefix );
749
+
750
+ switch (iapd -> state ) {
751
+ case IAPD_STATE_REQUEST :
752
+ tmp -> lease_tm = TIME_EPOCH ;
753
+ tmp -> net .len = 0 ;
754
+ memset (& tmp -> net .prefix , 0 , sizeof tmp -> net .prefix );
755
+ break ;
756
+
757
+ default :
758
+ break ;
759
+ }
738
760
}
739
761
740
762
iapd -> iostate = IAPD_IOSTATE_ERROR ;
You can’t perform that action at this time.
0 commit comments