NetworkPkg/IScsiDxe: Clean the previous ConfigData when switching the IP mode.

Cc: Karunakar P <karunakarp@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Karunakar p <karunakarp@amiindia.co.in>
This commit is contained in:
Jiaxin Wu 2017-10-18 12:58:15 +08:00
parent 067ca83822
commit b90741053d
1 changed files with 8 additions and 1 deletions

View File

@ -3592,8 +3592,15 @@ IScsiFormCallback (
switch (Value->u8) { switch (Value->u8) {
case IP_MODE_IP6: case IP_MODE_IP6:
case IP_MODE_IP4: case IP_MODE_IP4:
ZeroMem (IfrNvData->LocalIp, sizeof (IfrNvData->LocalIp));
ZeroMem (IfrNvData->SubnetMask, sizeof (IfrNvData->SubnetMask));
ZeroMem (IfrNvData->Gateway, sizeof (IfrNvData->Gateway));
ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp)); ZeroMem (IfrNvData->TargetIp, sizeof (IfrNvData->TargetIp));
Private->Current->AutoConfigureMode = 0; Private->Current->AutoConfigureMode = 0;
ZeroMem (&Private->Current->SessionConfigData.LocalIp, sizeof (EFI_IP_ADDRESS));
ZeroMem (&Private->Current->SessionConfigData.SubnetMask, sizeof (EFI_IPv4_ADDRESS));
ZeroMem (&Private->Current->SessionConfigData.Gateway, sizeof (EFI_IP_ADDRESS));
ZeroMem (&Private->Current->SessionConfigData.TargetIp, sizeof (EFI_IP_ADDRESS));
break; break;
} }