* [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue @ 2017-04-21 2:21 Jiaxin Wu 2017-04-21 2:21 ` [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration Jiaxin Wu 2017-04-21 2:25 ` [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Fu, Siyuan 0 siblings, 2 replies; 8+ messages in thread From: Jiaxin Wu @ 2017-04-21 2:21 UTC (permalink / raw) To: edk2-devel; +Cc: Eric Dong, Ye Ting, Fu Siyuan, Wu Jiaxin v2: * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network Device " instead of hard code in the code. Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic adjusted according the different MAC value. So, the string value shouldn't be treated as a constant string (Network Device). Otherwise, the display will be incorrect. Reproduce: Device Manager->Network Device List, select to enter MAC, then to press ESC back to previous page, then re-enter, found each enter/ESC operation, the MAC address display +1. Cc: Eric Dong <eric.dong@intel.com> 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> --- MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 8 ++++---- MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 5098b70..d2d3d76 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -538,16 +538,16 @@ CreateDeviceManagerForm( // // Update the network device form titile. // if (NextShowFormId == NETWORK_DEVICE_FORM_ID) { - String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL); - NewStringLen = StrLen(mSelectedMacAddrString) * 2; - NewStringLen += (StrLen(String) + 2) * 2; + String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL); + NewStringLen = StrLen (mSelectedMacAddrString) * 2; + NewStringLen += (StrLen (String) + 2) * 2; NewStringTitle = AllocatePool (NewStringLen); UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString); - HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); + HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); FreePool (String); FreePool (NewStringTitle); } // diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni index 061e4be..55d03d6 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni @@ -1,10 +1,10 @@ ///** @file // // String definitions for the Device Manager. // -// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR> +// Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR> // This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at // http://opensource.org/licenses/bsd-license.php // @@ -40,11 +40,12 @@ #language fr-FR "Missing String" #string STR_EMPTY_STRING #language en-US "" #language fr-FR "" #string STR_EXIT_STRING #language en-US "Press ESC to exit." #language fr-FR "Press ESC to exit." -#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device" +#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US "Network Device" +#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device" #language fr-FR "Network Device" #string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network Device Help..." #language fr-FR "Network Device Help..." #string STR_NETWORK_DEVICE_STRING #language en-US "Network Device" #language fr-FR "Network Device" -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration 2017-04-21 2:21 [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Jiaxin Wu @ 2017-04-21 2:21 ` Jiaxin Wu 2017-04-21 2:25 ` Fu, Siyuan 2017-04-21 2:48 ` Ye, Ting 2017-04-21 2:25 ` [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Fu, Siyuan 1 sibling, 2 replies; 8+ messages in thread From: Jiaxin Wu @ 2017-04-21 2:21 UTC (permalink / raw) To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin 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> --- MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index 5494231..54384e1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -1,10 +1,10 @@ /** @file Interface routine for Mtftp4. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php<BR> @@ -665,10 +665,14 @@ EfiMtftp4Configure ( Ip = NTOHL (Ip); Netmask = NTOHL (Netmask); Gateway = NTOHL (Gateway); ServerIp = NTOHL (ServerIp); + if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) { + return EFI_INVALID_PARAMETER; + } + if (!ConfigData->UseDefaultSetting && ((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) { return EFI_INVALID_PARAMETER; } -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration 2017-04-21 2:21 ` [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration Jiaxin Wu @ 2017-04-21 2:25 ` Fu, Siyuan 2017-04-21 2:48 ` Ye, Ting 1 sibling, 0 replies; 8+ messages in thread From: Fu, Siyuan @ 2017-04-21 2:25 UTC (permalink / raw) To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> -----Original Message----- From: Wu, Jiaxin Sent: 2017年4月21日 10:21 To: edk2-devel@lists.01.org Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration 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> --- MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index 5494231..54384e1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -1,10 +1,10 @@ /** @file Interface routine for Mtftp4. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php<BR> @@ -665,10 +665,14 @@ EfiMtftp4Configure ( Ip = NTOHL (Ip); Netmask = NTOHL (Netmask); Gateway = NTOHL (Gateway); ServerIp = NTOHL (ServerIp); + if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) { + return EFI_INVALID_PARAMETER; + } + if (!ConfigData->UseDefaultSetting && ((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) { return EFI_INVALID_PARAMETER; } -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration 2017-04-21 2:21 ` [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration Jiaxin Wu 2017-04-21 2:25 ` Fu, Siyuan @ 2017-04-21 2:48 ` Ye, Ting 1 sibling, 0 replies; 8+ messages in thread From: Ye, Ting @ 2017-04-21 2:48 UTC (permalink / raw) To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan Reviewed-by: Ye Ting <ting.ye@intel.com> -----Original Message----- From: Wu, Jiaxin Sent: Friday, April 21, 2017 10:21 AM To: edk2-devel@lists.01.org Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration 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> --- MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index 5494231..54384e1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -1,10 +1,10 @@ /** @file Interface routine for Mtftp4. (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php<BR> @@ -665,10 +665,14 @@ EfiMtftp4Configure ( Ip = NTOHL (Ip); Netmask = NTOHL (Netmask); Gateway = NTOHL (Gateway); ServerIp = NTOHL (ServerIp); + if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) { + return EFI_INVALID_PARAMETER; + } + if (!ConfigData->UseDefaultSetting && ((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) { return EFI_INVALID_PARAMETER; } -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue 2017-04-21 2:21 [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Jiaxin Wu 2017-04-21 2:21 ` [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration Jiaxin Wu @ 2017-04-21 2:25 ` Fu, Siyuan 2017-04-21 2:27 ` Wu, Jiaxin 1 sibling, 1 reply; 8+ messages in thread From: Fu, Siyuan @ 2017-04-21 2:25 UTC (permalink / raw) To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Dong, Eric, Ye, Ting Hi, Jiaxin Do we also need to add the lang "fr-FR" for STR_FORM_NETWORK_DEVICE_TITLE_HEAD? -----Original Message----- From: Wu, Jiaxin Sent: 2017年4月21日 10:21 To: edk2-devel@lists.01.org Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> Subject: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue v2: * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network Device " instead of hard code in the code. Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic adjusted according the different MAC value. So, the string value shouldn't be treated as a constant string (Network Device). Otherwise, the display will be incorrect. Reproduce: Device Manager->Network Device List, select to enter MAC, then to press ESC back to previous page, then re-enter, found each enter/ESC operation, the MAC address display +1. Cc: Eric Dong <eric.dong@intel.com> 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> --- MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 8 ++++---- MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index 5098b70..d2d3d76 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -538,16 +538,16 @@ CreateDeviceManagerForm( // // Update the network device form titile. // if (NextShowFormId == NETWORK_DEVICE_FORM_ID) { - String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NULL); - NewStringLen = StrLen(mSelectedMacAddrString) * 2; - NewStringLen += (StrLen(String) + 2) * 2; + String = HiiGetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL); + NewStringLen = StrLen (mSelectedMacAddrString) * 2; + NewStringLen += (StrLen (String) + 2) * 2; NewStringTitle = AllocatePool (NewStringLen); UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, mSelectedMacAddrString); - HiiSetString (HiiHandle, STRING_TOKEN (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); + HiiSetString (HiiHandle, STRING_TOKEN + (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); FreePool (String); FreePool (NewStringTitle); } // diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni index 061e4be..55d03d6 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni @@ -1,10 +1,10 @@ ///** @file // // String definitions for the Device Manager. // -// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR> +// Copyright (c) 2004 - 2017, Intel Corporation. All rights +reserved.<BR> // This program and the accompanying materials // are licensed and made available under the terms and conditions of the BSD License // which accompanies this distribution. The full text of the license may be found at // http://opensource.org/licenses/bsd-license.php // @@ -40,11 +40,12 @@ #language fr-FR "Missing String" #string STR_EMPTY_STRING #language en-US "" #language fr-FR "" #string STR_EXIT_STRING #language en-US "Press ESC to exit." #language fr-FR "Press ESC to exit." -#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device" +#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US "Network Device" +#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network Device" #language fr-FR "Network Device" #string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network Device Help..." #language fr-FR "Network Device Help..." #string STR_NETWORK_DEVICE_STRING #language en-US "Network Device" #language fr-FR "Network Device" -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue 2017-04-21 2:25 ` [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Fu, Siyuan @ 2017-04-21 2:27 ` Wu, Jiaxin 2017-04-21 2:36 ` Fu, Siyuan 0 siblings, 1 reply; 8+ messages in thread From: Wu, Jiaxin @ 2017-04-21 2:27 UTC (permalink / raw) To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Dong, Eric, Ye, Ting I think it's not necessary. Eric, what do you think? Thanks, Jiaxin > -----Original Message----- > From: Fu, Siyuan > Sent: Friday, April 21, 2017 10:25 AM > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> > Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the > network device MAC display issue > > Hi, Jiaxin > > Do we also need to add the lang "fr-FR" for > STR_FORM_NETWORK_DEVICE_TITLE_HEAD? > > > -----Original Message----- > From: Wu, Jiaxin > Sent: 2017年4月21日 10:21 > To: edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, > Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> > Subject: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network > device MAC display issue > > v2: > * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network > Device " > instead of hard code in the code. > > Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic > adjusted according the different MAC value. So, the string value shouldn't be > treated as a constant string (Network Device). Otherwise, the display will be > incorrect. > > Reproduce: Device Manager->Network Device List, select to enter MAC, > then to press ESC back to previous page, then re-enter, found each > enter/ESC operation, the MAC address display +1. > > Cc: Eric Dong <eric.dong@intel.com> > 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> > --- > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 8 > ++++---- > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni | 5 > +++-- > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > index 5098b70..d2d3d76 100644 > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > @@ -538,16 +538,16 @@ CreateDeviceManagerForm( > > // > // Update the network device form titile. > // > if (NextShowFormId == NETWORK_DEVICE_FORM_ID) { > - String = HiiGetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE), NULL); > - NewStringLen = StrLen(mSelectedMacAddrString) * 2; > - NewStringLen += (StrLen(String) + 2) * 2; > + String = HiiGetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL); > + NewStringLen = StrLen (mSelectedMacAddrString) * 2; > + NewStringLen += (StrLen (String) + 2) * 2; > NewStringTitle = AllocatePool (NewStringLen); > UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, > mSelectedMacAddrString); > - HiiSetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > + HiiSetString (HiiHandle, STRING_TOKEN > + (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > FreePool (String); > FreePool (NewStringTitle); > } > > // > diff --git > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > index 061e4be..55d03d6 100644 > --- > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > +++ > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > @@ -1,10 +1,10 @@ > ///** @file > // > // String definitions for the Device Manager. > // > -// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR> > +// Copyright (c) 2004 - 2017, Intel Corporation. All rights > +reserved.<BR> > // This program and the accompanying materials // are licensed and made > available under the terms and conditions of the BSD License // which > accompanies this distribution. The full text of the license may be found at // > http://opensource.org/licenses/bsd-license.php > // > @@ -40,11 +40,12 @@ > #language fr-FR "Missing String" > #string STR_EMPTY_STRING #language en-US "" > #language fr-FR "" > #string STR_EXIT_STRING #language en-US "Press ESC to exit." > #language fr-FR "Press ESC to exit." > -#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network > Device" > +#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US > "Network Device" > +#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US > "Network Device" > #language fr-FR "Network Device" > #string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network > Device Help..." > #language fr-FR "Network Device Help..." > #string STR_NETWORK_DEVICE_STRING #language en-US "Network > Device" > #language fr-FR "Network Device" > -- > 1.9.5.msysgit.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue 2017-04-21 2:27 ` Wu, Jiaxin @ 2017-04-21 2:36 ` Fu, Siyuan 2017-04-21 3:02 ` Wu, Jiaxin 0 siblings, 1 reply; 8+ messages in thread From: Fu, Siyuan @ 2017-04-21 2:36 UTC (permalink / raw) To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Dong, Eric, Ye, Ting Jiaxin, I think the HiiGetString() will return NULL pointer if the string is not present, then the code will ASSERT in the following StrLen() function. @retval NULL The string specified by StringId is not present in the string package. @retval Other The string was returned. Siyuan -----Original Message----- From: Wu, Jiaxin Sent: 2017年4月21日 10:27 To: Fu, Siyuan <siyuan.fu@intel.com>; edk2-devel@lists.01.org Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue I think it's not necessary. Eric, what do you think? Thanks, Jiaxin > -----Original Message----- > From: Fu, Siyuan > Sent: Friday, April 21, 2017 10:25 AM > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> > Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the > network device MAC display issue > > Hi, Jiaxin > > Do we also need to add the lang "fr-FR" for > STR_FORM_NETWORK_DEVICE_TITLE_HEAD? > > > -----Original Message----- > From: Wu, Jiaxin > Sent: 2017年4月21日 10:21 > To: edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com>; > Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> > Subject: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network > device MAC display issue > > v2: > * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network Device > " > instead of hard code in the code. > > Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic > adjusted according the different MAC value. So, the string value > shouldn't be treated as a constant string (Network Device). Otherwise, > the display will be incorrect. > > Reproduce: Device Manager->Network Device List, select to enter MAC, > then to press ESC back to previous page, then re-enter, found each > enter/ESC operation, the MAC address display +1. > > Cc: Eric Dong <eric.dong@intel.com> > 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> > --- > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 8 > ++++---- > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni | 5 > +++-- > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > index 5098b70..d2d3d76 100644 > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > @@ -538,16 +538,16 @@ CreateDeviceManagerForm( > > // > // Update the network device form titile. > // > if (NextShowFormId == NETWORK_DEVICE_FORM_ID) { > - String = HiiGetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE), NULL); > - NewStringLen = StrLen(mSelectedMacAddrString) * 2; > - NewStringLen += (StrLen(String) + 2) * 2; > + String = HiiGetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL); > + NewStringLen = StrLen (mSelectedMacAddrString) * 2; > + NewStringLen += (StrLen (String) + 2) * 2; > NewStringTitle = AllocatePool (NewStringLen); > UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, > mSelectedMacAddrString); > - HiiSetString (HiiHandle, STRING_TOKEN > (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > + HiiSetString (HiiHandle, STRING_TOKEN > + (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > FreePool (String); > FreePool (NewStringTitle); > } > > // > diff --git > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > index 061e4be..55d03d6 100644 > --- > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > +++ > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > @@ -1,10 +1,10 @@ > ///** @file > // > // String definitions for the Device Manager. > // > -// Copyright (c) 2004 - 2015, Intel Corporation. All rights > reserved.<BR> > +// Copyright (c) 2004 - 2017, Intel Corporation. All rights > +reserved.<BR> > // This program and the accompanying materials // are licensed and > made available under the terms and conditions of the BSD License // > which accompanies this distribution. The full text of the license may > be found at // http://opensource.org/licenses/bsd-license.php > // > @@ -40,11 +40,12 @@ > #language fr-FR "Missing String" > #string STR_EMPTY_STRING #language en-US "" > #language fr-FR "" > #string STR_EXIT_STRING #language en-US "Press ESC to exit." > #language fr-FR "Press ESC to exit." > -#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network > Device" > +#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US > "Network Device" > +#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US > "Network Device" > #language fr-FR "Network Device" > #string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network > Device Help..." > #language fr-FR "Network Device Help..." > #string STR_NETWORK_DEVICE_STRING #language en-US "Network > Device" > #language fr-FR "Network Device" > -- > 1.9.5.msysgit.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue 2017-04-21 2:36 ` Fu, Siyuan @ 2017-04-21 3:02 ` Wu, Jiaxin 0 siblings, 0 replies; 8+ messages in thread From: Wu, Jiaxin @ 2017-04-21 3:02 UTC (permalink / raw) To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Dong, Eric, Ye, Ting Thanks Siyuan, the new patch has been sent out to handle the NULL string. > -----Original Message----- > From: Fu, Siyuan > Sent: Friday, April 21, 2017 10:36 AM > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> > Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the > network device MAC display issue > > Jiaxin, > > I think the HiiGetString() will return NULL pointer if the string is not present, > then the code will ASSERT in the following StrLen() function. > @retval NULL The string specified by StringId is not present in the string > package. > @retval Other The string was returned. > > Siyuan > > -----Original Message----- > From: Wu, Jiaxin > Sent: 2017年4月21日 10:27 > To: Fu, Siyuan <siyuan.fu@intel.com>; edk2-devel@lists.01.org > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> > Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the > network device MAC display issue > > I think it's not necessary. > > Eric, what do you think? > > Thanks, > Jiaxin > > > -----Original Message----- > > From: Fu, Siyuan > > Sent: Friday, April 21, 2017 10:25 AM > > To: Wu, Jiaxin <jiaxin.wu@intel.com>; edk2-devel@lists.01.org > > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com> > > Subject: RE: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the > > network device MAC display issue > > > > Hi, Jiaxin > > > > Do we also need to add the lang "fr-FR" for > > STR_FORM_NETWORK_DEVICE_TITLE_HEAD? > > > > > > -----Original Message----- > > From: Wu, Jiaxin > > Sent: 2017年4月21日 10:21 > > To: edk2-devel@lists.01.org > > Cc: Dong, Eric <eric.dong@intel.com>; Ye, Ting <ting.ye@intel.com>; > > Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com> > > Subject: [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network > > device MAC display issue > > > > v2: > > * Define new STR_FORM_NETWORK_DEVICE_TITLE_HEAD for L" Network > Device > > " > > instead of hard code in the code. > > > > Network device tile (STR_FORM_NETWORK_DEVICE_TITLE) is dynamic > > adjusted according the different MAC value. So, the string value > > shouldn't be treated as a constant string (Network Device). Otherwise, > > the display will be incorrect. > > > > Reproduce: Device Manager->Network Device List, select to enter MAC, > > then to press ESC back to previous page, then re-enter, found each > > enter/ESC operation, the MAC address display +1. > > > > Cc: Eric Dong <eric.dong@intel.com> > > 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> > > --- > > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 8 > > ++++---- > > MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni | > 5 > > +++-- > > 2 files changed, 7 insertions(+), 6 deletions(-) > > > > diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > index 5098b70..d2d3d76 100644 > > --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c > > @@ -538,16 +538,16 @@ CreateDeviceManagerForm( > > > > // > > // Update the network device form titile. > > // > > if (NextShowFormId == NETWORK_DEVICE_FORM_ID) { > > - String = HiiGetString (HiiHandle, STRING_TOKEN > > (STR_FORM_NETWORK_DEVICE_TITLE), NULL); > > - NewStringLen = StrLen(mSelectedMacAddrString) * 2; > > - NewStringLen += (StrLen(String) + 2) * 2; > > + String = HiiGetString (HiiHandle, STRING_TOKEN > > (STR_FORM_NETWORK_DEVICE_TITLE_HEAD), NULL); > > + NewStringLen = StrLen (mSelectedMacAddrString) * 2; > > + NewStringLen += (StrLen (String) + 2) * 2; > > NewStringTitle = AllocatePool (NewStringLen); > > UnicodeSPrint (NewStringTitle, NewStringLen, L"%s %s", String, > > mSelectedMacAddrString); > > - HiiSetString (HiiHandle, STRING_TOKEN > > (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > > + HiiSetString (HiiHandle, STRING_TOKEN > > + (STR_FORM_NETWORK_DEVICE_TITLE), NewStringTitle, NULL); > > FreePool (String); > > FreePool (NewStringTitle); > > } > > > > // > > diff --git > > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > > index 061e4be..55d03d6 100644 > > --- > > a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > > +++ > > b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerStrings.uni > > @@ -1,10 +1,10 @@ > > ///** @file > > // > > // String definitions for the Device Manager. > > // > > -// Copyright (c) 2004 - 2015, Intel Corporation. All rights > > reserved.<BR> > > +// Copyright (c) 2004 - 2017, Intel Corporation. All rights > > +reserved.<BR> > > // This program and the accompanying materials // are licensed and > > made available under the terms and conditions of the BSD License // > > which accompanies this distribution. The full text of the license may > > be found at // http://opensource.org/licenses/bsd-license.php > > // > > @@ -40,11 +40,12 @@ > > #language fr-FR "Missing String" > > #string STR_EMPTY_STRING #language en-US "" > > #language fr-FR "" > > #string STR_EXIT_STRING #language en-US "Press ESC to exit." > > #language fr-FR "Press ESC to exit." > > -#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US "Network > > Device" > > +#string STR_FORM_NETWORK_DEVICE_TITLE_HEAD #language en-US > > "Network Device" > > +#string STR_FORM_NETWORK_DEVICE_TITLE #language en-US > > "Network Device" > > #language fr-FR "Network Device" > > #string STR_FORM_NETWORK_DEVICE_HELP #language en-US "Network > > Device Help..." > > #language fr-FR "Network Device Help..." > > #string STR_NETWORK_DEVICE_STRING #language en-US "Network > > Device" > > #language fr-FR "Network Device" > > -- > > 1.9.5.msysgit.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-04-21 3:02 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-04-21 2:21 [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Jiaxin Wu 2017-04-21 2:21 ` [Patch] MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration Jiaxin Wu 2017-04-21 2:25 ` Fu, Siyuan 2017-04-21 2:48 ` Ye, Ting 2017-04-21 2:25 ` [PATCH v2] MdeModulePkg/DeviceManagerUiLib: Fix the network device MAC display issue Fu, Siyuan 2017-04-21 2:27 ` Wu, Jiaxin 2017-04-21 2:36 ` Fu, Siyuan 2017-04-21 3:02 ` Wu, Jiaxin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox