NetworkPkg/DnsDxe: Update RetryCount/RetryInterval to comply with UEFI spec.

According to UEFI spec:
"Retry number if no response received after RetryInterval. If zero, use
the parameter configured through Dns.Configure() interface."
"Minimum interval of retry is 2 second. If the retry interval is less
than 2 second, then use the 2 second. If zero, use the parameter configured
through Dns.Configure() interface."

For both DNS.HostNameToIp and DNS.GeneralLookUp, the value of RetryCount /
RetryInterval need to be updated to comply with UEFI spec.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wang Fan <fan.wang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
Jiaxin Wu
2017-11-16 14:28:33 +08:00
parent 1b59de8444
commit cd2a624071
4 changed files with 67 additions and 48 deletions

View File

@@ -1948,7 +1948,7 @@ DnsOnTimerRetransmit (
// Retransmit the packet if haven't reach the maxmium retry count,
// otherwise exit the transfer.
//
if (++Dns4TokenEntry->Token->RetryCount < Instance->MaxRetry) {
if (++Dns4TokenEntry->RetryCounting <= Dns4TokenEntry->Token->RetryCount) {
DnsRetransmit (Instance, (NET_BUF *)ItemNetMap->Value);
EntryNetMap = EntryNetMap->ForwardLink;
} else {
@@ -1992,7 +1992,7 @@ DnsOnTimerRetransmit (
// Retransmit the packet if haven't reach the maxmium retry count,
// otherwise exit the transfer.
//
if (++Dns6TokenEntry->Token->RetryCount < Instance->MaxRetry) {
if (++Dns6TokenEntry->RetryCounting <= Dns6TokenEntry->Token->RetryCount) {
DnsRetransmit (Instance, (NET_BUF *) ItemNetMap->Value);
EntryNetMap = EntryNetMap->ForwardLink;
} else {