From b90741053d046fa56abd1f82e784e80db634e888 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Wed, 18 Oct 2017 12:58:15 +0800 Subject: [PATCH] NetworkPkg/IScsiDxe: Clean the previous ConfigData when switching the IP mode. Cc: Karunakar P Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Karunakar p --- NetworkPkg/IScsiDxe/IScsiConfig.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index 52e51d6b31..f20f590464 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -3592,9 +3592,16 @@ IScsiFormCallback ( switch (Value->u8) { case IP_MODE_IP6: 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)); 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; }