Jiaxin, > Actually, you don't need to retry the UDP configuration loop according > the Ip4Mode.IsConfigured flag. You are only recommended to set a > timer to check the mapping status after the configuration: > > For example: > Status = Nlc->Udp4->Configure(Nlc->Udp4, &Nlc->UdpConfig); > if (EFI_ERROR (Status) && (Status != EFI_NO_MAPPING)) { > return Status; > } > if (Status == EFI_NO_MAPPING && !UdpGetMapping (Nlc->Udp4)) { > return Status; > } > > In UdpGetMapping () function, create one timer to check > Ip4Mode.IsConfigured: > > For example: > UdpGetMapping () { > IsMapDone = FALSE; > gBS->CreateEvent (EVT_TIMER, TPL_CALLBACK, NULL, NULL, > &TimeoutEvent); > gBS->SetTimer (TimeoutEvent, TimerRelative, AnyValue); > while (EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) { > Udp4->Poll (Udp4); > Udp4->GetModeData (Udp4, &Udp4Mode, & Ip4Mode, NULL, > NULL); > if (Ip4Mode.IsConfigured) { > IsMapDone = TRUE; > break; > } > } > return IsMapDone; > } > > If DHCP process succeed, Ip4Mode.IsConfigured should be updated. If > not, any bug may be existed.
In testing the new patch (removing RECONFIG=TRUE) I see that the statement you made above is not accurate when the protocol is TCP. When Configure is called the first time it returns EFI_NO_MAPPING. This seems to be remembered in the socket state: ((Sock)->ConfigureState == SO_NO_MAPPING) so that any attempt to use the instance after Ip4Mode.IsConfigured goes TRUE fails (like for a TCP4 Listen). So for TCP we must issue another Configure request to clean up this state so it's not as simple as just polling the GetModeData result, at least for TCP. Do you believe this is expected behavior? Thanks, Eugene _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel