public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] NetworkPkg: Add check logic for iSCSI driver.
@ 2017-04-06  8:57 Zhang Lubo
  2017-04-11 12:01 ` Wu, Jiaxin
  2017-04-12  7:51 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Lubo @ 2017-04-06  8:57 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wu Jiaxin, Ye Ting, Fu Siyuan

Need to check variable of mPrivate whether is
null before used and redefine the array length
of target address for keyword.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
---
 NetworkPkg/IScsiDxe/IScsiConfig.c            | 30 ++++++++++++++--------------
 NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h |  2 +-
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 56a8685..a588403 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -742,28 +742,28 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
           ISCSI_CHAP_SECRET_STORAGE
           );
       }
     }
     CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, ATTEMPT_NAME_LIST_SIZE);
-  }
 
-  NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
-    NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
-    IScsiMacAddrToStr (
-    &NicInfo->PermanentAddress,
-    NicInfo->HwAddressSize,
-    NicInfo->VlanId,
-    MacString
-    );
-    CopyMem (
-      IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
-      MacString,
-      StrLen (MacString) * sizeof (CHAR16)
+    NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
+      NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
+      IScsiMacAddrToStr (
+      &NicInfo->PermanentAddress,
+      NicInfo->HwAddressSize,
+      NicInfo->VlanId,
+      MacString
       );
+      CopyMem (
+        IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
+        MacString,
+        StrLen (MacString) * sizeof (CHAR16)
+        );
 
-    *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
-   }
+      *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
+     } 
+  }
 }
 
 /**
   Convert the IFR data to iSCSI configuration data.
 
diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
index f89f320..22119ad 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
+++ b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
@@ -160,11 +160,11 @@ typedef struct {
   CHAR16  ISCSIIsId[ISID_CONFIGURABLE_STORAGE];
   CHAR16  ISCSIInitiatorIpAddress[IP4_STR_MAX_SIZE];
   CHAR16  ISCSIInitiatorNetmask[IP4_STR_MAX_SIZE];
   CHAR16  ISCSIInitiatorGateway[IP4_STR_MAX_SIZE];
   CHAR16  ISCSITargetName[ISCSI_NAME_MAX_SIZE];
-  CHAR16  ISCSITargetIpAddress[IP_STR_MAX_SIZE];
+  CHAR16  ISCSITargetIpAddress[ISCSI_TARGET_URI_MAX_SIZE];
   CHAR16  ISCSILun[ISCSI_LUN_STR_MAX_LEN];
   CHAR16  ISCSIChapUsername[ISCSI_CHAP_NAME_STORAGE];
   CHAR16  ISCSIChapSecret[ISCSI_CHAP_SECRET_STORAGE];
   CHAR16  ISCSIReverseChapUsername[ISCSI_CHAP_NAME_STORAGE];
   CHAR16  ISCSIReverseChapSecret[ISCSI_CHAP_SECRET_STORAGE];
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] NetworkPkg: Add check logic for iSCSI driver.
  2017-04-06  8:57 [patch] NetworkPkg: Add check logic for iSCSI driver Zhang Lubo
@ 2017-04-11 12:01 ` Wu, Jiaxin
  2017-04-12  7:51 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2017-04-11 12:01 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Ye, Ting, Fu, Siyuan

Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>

Thanks,
Jiaxin

> -----Original Message-----
> From: Zhang, Lubo
> Sent: Thursday, April 6, 2017 4:58 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu,
> Siyuan <siyuan.fu@intel.com>
> Subject: [patch] NetworkPkg: Add check logic for iSCSI driver.
> 
> Need to check variable of mPrivate whether is
> null before used and redefine the array length
> of target address for keyword.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> ---
>  NetworkPkg/IScsiDxe/IScsiConfig.c            | 30 ++++++++++++++--------------
>  NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h |  2 +-
>  2 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c
> b/NetworkPkg/IScsiDxe/IScsiConfig.c
> index 56a8685..a588403 100644
> --- a/NetworkPkg/IScsiDxe/IScsiConfig.c
> +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
> @@ -742,28 +742,28 @@
> IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
>            ISCSI_CHAP_SECRET_STORAGE
>            );
>        }
>      }
>      CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList,
> ATTEMPT_NAME_LIST_SIZE);
> -  }
> 
> -  NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
> -    NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
> -    IScsiMacAddrToStr (
> -    &NicInfo->PermanentAddress,
> -    NicInfo->HwAddressSize,
> -    NicInfo->VlanId,
> -    MacString
> -    );
> -    CopyMem (
> -      IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
> -      MacString,
> -      StrLen (MacString) * sizeof (CHAR16)
> +    NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
> +      NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
> +      IScsiMacAddrToStr (
> +      &NicInfo->PermanentAddress,
> +      NicInfo->HwAddressSize,
> +      NicInfo->VlanId,
> +      MacString
>        );
> +      CopyMem (
> +        IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
> +        MacString,
> +        StrLen (MacString) * sizeof (CHAR16)
> +        );
> 
> -    *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
> -   }
> +      *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
> +     }
> +  }
>  }
> 
>  /**
>    Convert the IFR data to iSCSI configuration data.
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
> b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
> index f89f320..22119ad 100644
> --- a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
> +++ b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
> @@ -160,11 +160,11 @@ typedef struct {
>    CHAR16  ISCSIIsId[ISID_CONFIGURABLE_STORAGE];
>    CHAR16  ISCSIInitiatorIpAddress[IP4_STR_MAX_SIZE];
>    CHAR16  ISCSIInitiatorNetmask[IP4_STR_MAX_SIZE];
>    CHAR16  ISCSIInitiatorGateway[IP4_STR_MAX_SIZE];
>    CHAR16  ISCSITargetName[ISCSI_NAME_MAX_SIZE];
> -  CHAR16  ISCSITargetIpAddress[IP_STR_MAX_SIZE];
> +  CHAR16  ISCSITargetIpAddress[ISCSI_TARGET_URI_MAX_SIZE];
>    CHAR16  ISCSILun[ISCSI_LUN_STR_MAX_LEN];
>    CHAR16  ISCSIChapUsername[ISCSI_CHAP_NAME_STORAGE];
>    CHAR16  ISCSIChapSecret[ISCSI_CHAP_SECRET_STORAGE];
>    CHAR16  ISCSIReverseChapUsername[ISCSI_CHAP_NAME_STORAGE];
>    CHAR16  ISCSIReverseChapSecret[ISCSI_CHAP_SECRET_STORAGE];
> --
> 1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] NetworkPkg: Add check logic for iSCSI driver.
  2017-04-06  8:57 [patch] NetworkPkg: Add check logic for iSCSI driver Zhang Lubo
  2017-04-11 12:01 ` Wu, Jiaxin
@ 2017-04-12  7:51 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-04-12  7:51 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Wu, Jiaxin, Fu, Siyuan

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Zhang, Lubo 
Sent: Thursday, April 06, 2017 4:58 PM
To: edk2-devel@lists.01.org
Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: [patch] NetworkPkg: Add check logic for iSCSI driver.

Need to check variable of mPrivate whether is null before used and redefine the array length of target address for keyword.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
---
 NetworkPkg/IScsiDxe/IScsiConfig.c            | 30 ++++++++++++++--------------
 NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h |  2 +-
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c
index 56a8685..a588403 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfig.c
+++ b/NetworkPkg/IScsiDxe/IScsiConfig.c
@@ -742,28 +742,28 @@ IScsiConvertAttemptConfigDataToIfrNvDataByKeyword (
           ISCSI_CHAP_SECRET_STORAGE
           );
       }
     }
     CopyMem(IfrNvData->ISCSIDisplayAttemptList, AttemptNameList, ATTEMPT_NAME_LIST_SIZE);
-  }
 
-  NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
-    NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
-    IScsiMacAddrToStr (
-    &NicInfo->PermanentAddress,
-    NicInfo->HwAddressSize,
-    NicInfo->VlanId,
-    MacString
-    );
-    CopyMem (
-      IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
-      MacString,
-      StrLen (MacString) * sizeof (CHAR16)
+    NET_LIST_FOR_EACH (Entry, &mPrivate->NicInfoList) {
+      NicInfo = NET_LIST_USER_STRUCT (Entry, ISCSI_NIC_INFO, Link);
+      IScsiMacAddrToStr (
+      &NicInfo->PermanentAddress,
+      NicInfo->HwAddressSize,
+      NicInfo->VlanId,
+      MacString
       );
+      CopyMem (
+        IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr),
+        MacString,
+        StrLen (MacString) * sizeof (CHAR16)
+        );
 
-    *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
-   }
+      *(IfrNvData->ISCSIMacAddr + StrLen (IfrNvData->ISCSIMacAddr)) = L'/';
+     }
+  }
 }
 
 /**
   Convert the IFR data to iSCSI configuration data.
 
diff --git a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
index f89f320..22119ad 100644
--- a/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
+++ b/NetworkPkg/IScsiDxe/IScsiConfigNVDataStruc.h
@@ -160,11 +160,11 @@ typedef struct {
   CHAR16  ISCSIIsId[ISID_CONFIGURABLE_STORAGE];
   CHAR16  ISCSIInitiatorIpAddress[IP4_STR_MAX_SIZE];
   CHAR16  ISCSIInitiatorNetmask[IP4_STR_MAX_SIZE];
   CHAR16  ISCSIInitiatorGateway[IP4_STR_MAX_SIZE];
   CHAR16  ISCSITargetName[ISCSI_NAME_MAX_SIZE];
-  CHAR16  ISCSITargetIpAddress[IP_STR_MAX_SIZE];
+  CHAR16  ISCSITargetIpAddress[ISCSI_TARGET_URI_MAX_SIZE];
   CHAR16  ISCSILun[ISCSI_LUN_STR_MAX_LEN];
   CHAR16  ISCSIChapUsername[ISCSI_CHAP_NAME_STORAGE];
   CHAR16  ISCSIChapSecret[ISCSI_CHAP_SECRET_STORAGE];
   CHAR16  ISCSIReverseChapUsername[ISCSI_CHAP_NAME_STORAGE];
   CHAR16  ISCSIReverseChapSecret[ISCSI_CHAP_SECRET_STORAGE];
--
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-12  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06  8:57 [patch] NetworkPkg: Add check logic for iSCSI driver Zhang Lubo
2017-04-11 12:01 ` Wu, Jiaxin
2017-04-12  7:51 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox