summaryrefslogtreecommitdiff
path: root/NetworkPkg
AgeCommit message (Collapse)AuthorFilesLines
2 daysNetworkPkg/DnsDxe: Bound query name length in ParseDnsResponsejmestwa-coder1-1/+1
ParseDnsResponse() computes the query name length with AsciiStrLen on bytes taken straight from the received UDP datagram, before any bounds check. AsciiStrLen has no length cap in RELEASE builds, so a response whose question-name field carries no terminating zero makes the scan read past the end of the packet buffer returned by NetbufGetByte, an out-of-bounds read driven by attacker-controlled network input. Bound the scan with AsciiStrnLenS limited to RemainingLength, the bytes available from the name onward. The existing RemainingLength check then rejects a name that never terminates, which also makes the later AsciiStrLen(QueryName) uses provably in-bounds. Signed-off-by: Syed Mohammed Nayyar <jmestwa@gmail.com>
9 daysNetworkPkg/IScsiDxe: Validate DHCPv6 RootPath fields200004196-8/+321
Use UINTN for parser cursor and field lengths, and validate delimiters before advancing through the input. Add host-based coverage for a valid DNS RootPath and rejection of an overlong server name. Signed-off-by: 20000419 <lzy20000419@outlook.com>
2026-09-04NetworkPkg/IScsiDxe: Fix incorrect TargetUrl terminator indexMichael Kubacki2-2/+2
The Len field is set to string length. Since the array is zero-based, the terminator index should be set to Len instead of Len + 1. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-29Global: Set MarkdownLintCheck plugin to AuditOnlyMichael Kubacki1-0/+6
In preparation for the MarkdownLintCheck plugin being added to the repo, this change defaults the plugin to `AuditOnly` mode in each package. This allows package maintainers to enable the plugin as they see fit. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-14NetworkPkg/UefiPxeBcDxe: Fix CopyMem destination in PxeBcDhcp6CallBackabuthahirm1-1/+1
When caching the DHCPv6 discover packet to Mode->DhcpDiscover in PxeBcDhcp6CallBack, the destination was incorrectly specified as Mode->DhcpDiscover.Dhcpv4 (the DHCPv4 union member). Change it to Mode->DhcpDiscover to correctly reference the union and avoid type confusion when copying a DHCPv6 packet. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14NetworkPkg/Ip6Dxe: Add NULL check for InterfaceId before dereferenceabuthahirm1-0/+1
In Ip6ProcessRouterAdvertise, IpSb->InterfaceId is dereferenced in CopyMem to form a stateless address. Add a guard to ensure IpSb->InterfaceId is not NULL before entering the block, preventing a potential NULL pointer dereference. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14NetworkPkg/Ip6Dxe: Move neighbor table cleanup before MNP teardownabuthahirm1-8/+8
In Ip6CleanService, Ip6FreeNeighborEntry may attempt to send packets via MNP. Defensively move the neighbor table cleanup to occur before MNP teardown so that the MNP child handle and its resources remain valid during neighbor entry cleanup. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14NetworkPkg/Dhcp6Dxe: Defensively check for NULL Config in Dhcp6UpdateIaInfoabuthahirm2-2/+4
Replace the ASSERT (Instance->Config != NULL) in Dhcp6UpdateIaInfo with an explicit NULL check that returns EFI_DEVICE_ERROR. Also add a complementary guard in Dhcp6GenerateIaCb alongside the existing check for Instance->IaCb.Ia. These are defensive changes to prevent potential NULL pointer dereferences. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-06-30NetworkPkg/SnpDxe: Fix MAC address passthrough supportJared Pan1-0/+11
During SnpUndi32Initialize(), CurrentAddress is unconditionally overwritten with PermanentAddress before UNDI initialization. This causes MAC address passthrough (MacPassthru) to fail, as the NIC's actual current address, which may differ from its permanent address, is lost. After UNDI initialization completes, call PxeGetStnAddr() to read the NIC's station address via the UNDI interface and update CurrentAddress, PermanentAddress, and BroadcastAddress in the mode structure with the values reported by the hardware. The call is added to both initialization paths: the cable-detect success path and the fallback no-cable-detect path. Signed-off-by: Jared Pan <jared.pan@dell.com>
2026-06-30NetworkPkg/IScsiDxe: bound value length in IScsiBuildKeyValueListSyed Mohammed Nayyar1-1/+1
IScsiBuildKeyValueList parses the data segment of a received iSCSI login, text or CHAP response into key=value pairs. After locating '=' within the remaining length, it sets KeyValuePair->Value and calls AsciiStrLen(Value) to measure the value before subtracting it from the remaining length. AsciiStrLen has no length cap, and the data segment copied from the received PDU (AllocatePool(Len) + NetbufQueCopy of the data-segment length) is not guaranteed to be NUL-terminated. A malicious or redirecting target can send a data segment whose final value lacks a trailing NUL (e.g. the 3 bytes "X=Y"), so AsciiStrLen reads past the end of the segment allocation, an attacker-controlled out-of-bounds read. The SafeUint32Sub bound check only runs after the over-read. Replace AsciiStrLen(Value) with AsciiStrnLenS(Value, Len), capping the scan to the bytes remaining from Value onward. An unterminated value then returns Len and the existing SafeUint32Sub rejects the segment. The single change covers all three callers (login redirect, operational parameter negotiation and CHAP). Signed-off-by: Syed Mohammed Nayyar <jmestwa@gmail.com>
2026-06-25NetworkPkg/UefiPxeBcDxe: Initialize IPV4 token in IPV4 branchMichael Kubacki1-8/+8
EfiPxeBcStart() in PxeBcImpl.c has conditional code branches for IPV4 and IPV6. - IPV4 branch should use EFI_IP4_COMPLETION_TOKEN which is Private->IcmpToken. - IPV6 branch should use EFI_IP6_COMPLETION_TOKEN which is Private->Icmp6Token. Right now, the IPv4 branch incorrectly initializes Private->Icmp6Token to EFI_NOT_READY. That is changed to Private->IcmpToken. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-24NetworkPkg: Ip4Dxe: Fix uninitialized variable warningTuan Phan1-49/+47
In Ip4FormExtractConfig(), the Status variable was assigned only within a conditional block but used outside of it, which could lead to an uninitialized variable warning. Fix this by moving the relevant code outside of the conditional block so that Status is always properly initialized before use. Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-06-24NetworkPkg: HttpBootDxe: Fix uninitialized variable warningsTuan Phan1-12/+14
In HttpBootGetBootFileCaller(), under the LoadBootFile case, the Status variable is only assigned within a for loop. If the loop is not executed, this results in an uninitialized variable warning when Status is later referenced. Resolve this issue by return Status directly inside the loop. Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-06-19NetworkPkg/Dhcp6Dxe: bound IA inner option length to bufferjmestwa-coder3-2/+192
Dhcp6SeekInnerOptionSafe() reads the IA_NA/IA_TA option-len field from a received datagram and only validates it against the fixed minimums, never against OptionLen (the bytes actually remaining in the packet). A reply can declare an option-len up to 0xFFFF while the real buffer is only the 16-byte (IA_NA) or 8-byte (IA_TA) minimum, so the returned inner length is far larger than the buffer. That length is then passed as SeekLen to Dhcp6SeekOption(), which walks ReadUnaligned16() cursors up to Buf + SeekLen and reads past the end of the packet allocation, an attacker-controlled out-of-bounds read. Bound the declared inner length against OptionLen minus the IA header size in both the IA_NA and IA_TA branches, rejecting over-declared options with EFI_DEVICE_ERROR. Parenthesize DHCP6_MIN_SIZE_OF_IA_NA so the subtraction in that bound binds correctly. Add host tests covering the over-declared, off-by-one, and exact-boundary cases for both IA_NA and IA_TA. Signed-off-by: jmestwa-coder <jmestwa@gmail.com>
2026-06-10NetworkPkg/IScsiDxe: Fix AttemptName cleared on loading defaultsabuthahirm2-1/+50
Root Cause: The AttemptName string field in IScsiConfigVfr.vfr had default = STRING_TOKEN(STR_NULL), which resolves to an empty string. When optimized defaults are loaded (F3), the form browser resets every field to its defined default, wiping out the actual attempt names (e.g. Attempt 1, Attempt 2) and leaving the field blank. Fix: Add the INTERACTIVE flag to the AttemptName string field in VFR. This tells the form browser to invoke the driver callback when loading defaults instead of applying the hardcoded empty string. Introduce a helper function IScsiGetAttemptNameDefault() that reads the stored attempt name from mCallbackInfo->Current->AttemptName, registers it as a HII string, and returns it as the default value. The helper also validates that the question type is EFI_IFR_TYPE_STRING before accessing Value->string. In IScsiFormCallback, handle EFI_BROWSER_ACTION_DEFAULT_STANDARD, EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING, and EFI_BROWSER_ACTION_DEFAULT_SAFE for KEY_ATTEMPT_NAME by delegating to the helper. This ensures loading any class of defaults always restores the correct attempt name for whichever attempt is open. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-06-04NetworkPkg/HttpDxe: Fix missing error check in TlsCommonTransmitabuthahirm1-0/+5
In HttpsReceive(), the return value of TlsCommonTransmit() was not checked. Add error handling with proper cleanup of PacketOut and BufferOut before returning on failure. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: abuthahirm <abuthahirm@ami.com>
2026-06-04NetworkPkg/DnsDxe: Add error check for Dhcp4->Buildabuthahirm1-0/+8
In GetDns4ServerFromDhcp4(), the return value of Dhcp4->Build() was not checked. Add error handling and a NULL check on the resulting Token.Packet before use. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: abuthahirm <abuthahirm@ami.com>
2026-06-04NetworkPkg: Remove redundant Status initializationsabuthahirm21-100/+36
Remove redundant Status = EFI_SUCCESS and Status = EFI_DEVICE_ERROR initializations that are immediately overwritten before being read, across multiple modules: Dhcp6Dxe, DnsDxe, HttpBootDxe, HttpDxe, Ip4Dxe, Ip6Dxe, MnpDxe, Mtftp4Dxe, Mtftp6Dxe, SnpDxe, TcpDxe, TlsAuthConfigDxe, UefiPxeBcDxe and WifiConnectionManagerDxe. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: abuthahirm <abuthahirm@ami.com>
2026-05-30NetworkPkg/DpcDxe: Stop adding entries on allocation failureDongyan Qian1-0/+2
DpcQueueDpc() expands the DPC entry free list when it is empty. If an allocation fails after at least one entry has already been added to the free list, the current code continues and inserts the failed allocation result into the list. Stop expanding the free list when an allocation fails and the free list already contains entries. The caller can then continue with one of the entries that was successfully allocated. Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-05-25NetworkPkg/TcpDxe: Skip RST when no IpIo sender exists for DstMatthew Graham1-2/+9
Unknown or closed segments still go down the RST path into TcpSendIpPacket. When no IpIo sender exists for the destination, each packet logs “No appropriate IpSender.” next to the usual discard traces and floods the console. The change calls IpIoFindSender before SEND_RESET and discards when it fails, which stops that storm and leaves normal RST behavior unchanged when a sender is present. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Cc: Mike Beaton <mjsbeaton@gmail.com> Signed-off-by: Matthew Graham <Matthew.Graham@amd.com>
2026-05-01NetworkPkg/DnsDxe: Refactor answer loop to for in ParseDnsResponseabuthahirm1-8/+8
The answer section loop in ParseDnsResponse() iterated a counter AnswerSectionNum from 0 to DnsHeader->AnswersNum using a while loop with a manual increment at the bottom. Convert it to an equivalent for loop to make the initialization, condition, and increment explicit. Also replace the unconditional Status = EFI_NOT_FOUND assignment before the loop with a conditional that only sets it when the loop is never entered (DnsHeader->AnswersNum == 0). ParseDnsResponse() initializes Status to EFI_SUCCESS at function entry, and the loop body always overwrites Status, so the pre-assignment was dead code in the common case. The conditional form makes the intent explicit: EFI_NOT_FOUND is only the result when there are no answer records. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: abuthahirm <abuthahirm@ami.com>
2026-05-01NetworkPkg/Ip4Dxe: Fix missing Status check on Ip4Cfg2->SetData callabuthahirm1-1/+1
In Ip4Config2ConvertIfrNvDataToConfigNvData(), when the policy is changed away from a static configuration (PolicyChanged is TRUE), the first call to Ip4Cfg2->SetData() was not checking its return value and always returned EFI_SUCCESS. Fix this to check and return Status on error, consistent with the second SetData call in the same function. Cc: Saloni Kasbekar <saloni.kasbekar@intel.com> Cc: Zachary Clark-williams <zachary.clark-williams@intel.com> Signed-off-by: abuthahirm <abuthahirm@ami.com>
2026-04-30NetworkPkg/Ip4Dxe: Reject IPv4 addresses ending with dotabuthahirm1-40/+4
Issue: UI accepts invalid IPv4 addresses ending with a dot in the IPv4 Network Configuration page. Examples: - Local IP Address: 192.168.1.10. - Subnet Mask: 255.255.255.0. - Gateway: 2.2.2.2. - DNS Servers: 1.1.1.1. Root Cause: The function Ip4Config2StrToIp converts user-entered IPv4 strings into numbers. When an address ending with a dot like '1.1.1.1.' is entered, the code skips over the 4th dot, reaches the string's null terminator, and incorrectly treats it as valid. Fix: Refactor Ip4Config2StrToIp to be a thin wrapper around the existing BaseLib StrToIpv4Address() helper. After parsing, the EndPointer is checked to ensure the entire string was consumed (i.e. EndPointer points to the null terminator). Any trailing characters, including a trailing dot, cause EFI_INVALID_PARAMETER to be returned. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-04-29NetworkPkg/GoogleTest: Remove duplicate file name in INF fileQihang Gao1-1/+0
In GoogleTest driver, Ip6OptionGoogleTest.h appears twice in [Sources] section, so remove the duplicate one. Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-04-28NetworkPkg/HttpBootDxe: Add all events to HttpBootHttpCallback()copilot-swe-agent[bot]2-6/+17
Include other events from EDKII_HTTP_CALLBACK_EVENT to print failure information in the event of HTTP Boot failure Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
2026-04-06NetworkPkg/HttpBootDxe: Print TLS errors on screen during HTTP bootSaloni Kasbekar4-6/+115
Install EDKII_HTTP_CALLBACK_PROTOCOL in HttpBootDxe to receive TLS events from HttpDxe during the HTTP Boot process. When a TLS error occurs (failed TLS session connection or TLS configuration), print an error message on screen using AsciiPrint(). The callback is installed in HttpBootInstallCallback() and uninstalled in HttpBootUninstallCallback(), ensuring TLS errors are only printed during the HTTP Boot process and not for other TLS accesses. Signed-off-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
2026-04-01NetworkPkg/UefiPxeBcDxe: Add missing Token.Context initializationMichael Kubacki1-0/+2
Adds missing `Token.Context = Private` initialization in two MTFTP write-file functions. Without this, the `Context` field passed to the MTFTP `WriteFile` callback was uninitialized, which could lead to a page fault when the callback attempted to access the `Private` driver context. The corresponding read-file functions already set this field correctly. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-03-26NetworkPkg: Reset DHCP Service Binding IO Status on StopMichael Kubacki1-0/+1
Resets DhcpSb->IoStatus on stop to prevent a stale state from persisting which might impact future operations dependent on the IO status. Co-authored-by: Wenbo Hou <wenbhou@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-03-18NetworkPkg: Ip4Dxe/Ip6Dxe: Set SB notify to NULL after event closeMichael Kubacki2-0/+2
Ip4StartAutoConfig() and Ip6ConfigStartStatefulAutoConfig() close the DHCP service binding notify event when the service child is successfully created, but do not NULL the instance field afterward. On re-entry, the stale handle passes the non-NULL condition and is closed a second time, which results in a page fault with memory protections enabled. This change sets the event field to NULL immediately after CloseEvent() so that subsequent calls skip attempting to close the event again. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-03-02NetworkPkg: align UNI file headers with UNI Spec standardAlexander Gryanko4-31/+31
The Uni file standard specifies that comments begin with the characters "//". The following files contained incorrectly formatted C-style comments and have been updated: NetworkPkg/Application/VConfig/VConfigStrings.uni NetworkPkg/HttpBootDxe/HttpBootConfigStrings.uni NetworkPkg/Ip6Dxe/Ip6DxeStrings.uni NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni The problems were identified during testing of the parser https://github.com/xpahos/edk2-idea. Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-02-24NetworkPkg: Replace include guards with #pragma onceMichael Kubacki140-560/+140
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-01-23NetworkPkg/UefiPxeBcDxe: Fix typo in Buffer parameter descriptionDongyan Qian1-1/+1
The comment for the Buffer parameter incorrectly said "then no the size" instead of "then the size". This patch fixes the typo only; no functional changes. Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-01-07NetworkPkg: Add VS2026 toolchain supportDaniel1-1/+1
* Add VS2026 to toolchain check in NetworkPkgHostTest.dsc. Signed-off-by: Daniel Grobert <danalexgro@gmail.com>
2025-12-29NetworkPkg: Add RngLib mapping for LOONGARCH64Qihang Gao1-0/+3
NetworkPkg will build failed on LOONGARCH64 platform, because LOONGARCH64 don't support MdePkg/Library/BaseRngLib. So add MdeModulePkg/Library/BaseRngLibTimerLib as BaseRngLib of LOONGARCH64 platform. Signed-off-by: Qihang Gao <gaoqihang@loongson.cn> Cc: Chao Li <lichao@loongson.cn>
2025-11-22NetworkPkg: Remove unused variableMike Beaton1-7/+0
XCODE5 toolchain finds this, with error: WifiConnectionMgrHiiConfigAccess.c:393:29: error: variable 'AvailableCount' set but not used Fixes: https://github.com/tianocore/edk2/commit/90b24889f9ced53c18b73266d507e45fbd94fab0 Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2025-11-22NetworkPkg: fix various typosPhilipp Schuster1-1/+1
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2025-11-21OvmfPkg,ArmVirtPkg,NetworkPkg: Fix build with -D NETWORK_ENABLE=0Mike Beaton1-10/+13
Previous PR https://github.com/tianocore/edk2/pull/6087 restored the ability to build OvmfPkg with -D NETWORK_ENABLE=0. b3b3cfab7eb52acd77558a9727196e30d05d1f2a has broken it again, since the .dsc references to OvmfPkg/VirtioNetDxe/VirtioNet.inf were moved from outside !if $(NETWORK_ENABLE) == TRUE to inside it, while the .fdf references remained outside. In discussion in https://github.com/tianocore/edk2/pull/11719 it was decided to move the .fdf references inside the conditional, i.e. not to include VirtioNetDxe unless the rest of the network stack is being built. Removal of VirtioNetDxe driver on -D NETWORK_ENABLE=0 has only been applied to those packages which are already using OvmfPkg/Dsc/Includes/NetworkComponents.dsc.inc. f9408b7cc160030c3bb9627c8086a792cc2d046c introduces new PCDs which also need to be moved inside a NETWORK_ENABLE test in order to allow building with -D NETWORK_ENABLE=0, which is also done here. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2025-10-31NetworkPkg/SnpDxe: Fix Snp used uninitializedeeshanl1-0/+2
Ensures the Snp Structure is initialized as NULL. Signed-off-by: Eeshan Londhe <eeshanlondhe@microsoft.com>
2025-10-30NetworkPkg: Remove DXE_SAL_DRIVERSathya Ravichandran1-1/+1
The DXE_SAL_DRIVER module type was introduced to support Itanium (IPF) platforms. Since support for Itanium processors has been dropped, the instances of DXE_SAL_DRIVER have been removed. Ref: [3cb0a311cb7e747d7be5c5076d0fff76ad256d2b] Cc: Sachin Ganesh <sachinganesh@ami.com> Signed-off-by: Sathya Ravichandran <sathyar@ami.com>
2025-10-29NetworkPkg/SnpDxe: Update SnpDxe SNP_DRIVER struct out of DMA-able memory.eeshanl16-424/+551
CPB, DB, and CDB structs to use DMA-able memory. Updates the overall SNP_DRIVER allocation to use AllocatePool() instead of PciIo->AllocateBuffer(). This moves this struct out of DMA-able memory. Allocates the PXE_CDB struct as a pointer instead, using PciIo->AllocateBuffer() for DMA-able memory. End result: CPB, DB, and CDB are allocated with individual PciIo->AllocateBuffer() calls with a size of 4096 for CPB and DB. and sizeof(PXE_CDB) for CDB. Each of these members point to locations within the Allocated Buffer, and all of these pointers are at-least 8-Byte aligned. SNP_DRIVER is allocated with AllocatePool() In the SNP_DRIVER structure, the PXE_CDB member is changed to a pointer so we can allocate it with PciIo->AllocateBuffer() Signed-off-by: Eeshan Londhe <eeshanlondhe@microsoft.com>
2025-10-01NetworkPkg/UefiPxeBcDxe: Add buffer check before reporting status codeMarc Chen1-6/+13
When PxeBcLoadBootFile() fails, it reports a status code to notify listeners (such as telemetry/SEL logging drivers) about the error. However, the current implementation reports the status code for all error conditions, including benign cases, such as where the caller passes Buffer == NULL with EFI_BUFFER_TOO_SMALL to query the required size. This causes false positive error reports in telemetry systems, as EFI_BUFFER_TOO_SMALL with Buffer == NULL is an expected and normal operation for size queries, not an actual error condition. The PXE-E05 error message is already correctly guarded with the condition "(Status == EFI_BUFFER_TOO_SMALL) && (Buffer != NULL)", but the status code reporting was unconditional. Add a buffer null check before REPORT_STATUS_CODE_WITH_EXTENDED_DATA to ensure status codes are only reported for actual errors: - Report when Status != EFI_BUFFER_TOO_SMALL (all other errors) - Report when Status == EFI_BUFFER_TOO_SMALL AND Buffer != NULL (PXE-E05) - Skip when Status == EFI_BUFFER_TOO_SMALL AND Buffer == NULL (size query) This prevents spurious error logs while maintaining proper error reporting for genuine failures including PXE-E05, PXE-E07, PXE-E09, PXE-E99, and all other error conditions. Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2025-10-01NetworkPkg: Use the newly introduced ShellPrintHiiDefaultEx() aliasPierre Gondois1-24/+21
Make use the newly introduced ShellPrintHiiDefaultEx() alias and replace wherever it is possible: - "ShellPrintHiiEx (-1, -1, NULL," with: - "ShellPrintHiiDefaultEx (" No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-09-26NetworkPkg: Drop ARM32 SupportOliver Smith-Denny5-16/+2
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 code from NetworkPkg. This also drops irrelevant VALID_ARCHITECTURES comments from infs that are not arch specific. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-18NetworkPkg/UefiPceBcDxe/GoogleTest: Add missing EFIAPIMichael D Kinney1-0/+3
CLANGDWARF generates a build error for calling convention mismatch in UdpRead(), UdpWrite(), and Configure() mock functions. Add EFIAPI so mock function matches function prototype of function being mocked. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-18NetworkPkg/Dhcp6Dxe/GoogleTest: Fix init of complex structMichael D Kinney1-2/+4
CLANGDWARF generates build error for missing braces when initializing a complex structure. Change initialization of EFI_DHCP6_IA local variable to a call to ZeroMem() instead. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-04NetworkPkg/TlsDxe: Add SNI supportINDIA\kanagavels1-0/+4
Add Server Name Indication Support. Signed-off-by: Kanagavel S <kanagavels@ami.com>
2025-08-25NetworkPkg/WifiConnectionManagerDxe: UI DisconnectZachary Clark-Williams1-1/+1
- Fix WifiMgrOnTimerTick to ensure the timer does not exit early when a disconnect is pending, allowing UI-initiated disconnects to complete as expected. Signed-off-by: Zachary Clark-Williams <Zachary.Clark-Williams@intel.com>
2025-07-04NetworkPkg: Correct spelling errors and typosAbdul Lateef Attar1-2/+2
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-06-25NetworkPkg/WifiConnectionManager: net list scan uiZachary Clark-Williams1-0/+5
Commit 7c204d7 changed the behavior of the WiFi Connection Manager. It no longer scans for available networks when the driver loads, because scanning during that time disrupts connections for other features. To avoid blocking other processes, the driver should initiate a scan only when appropriate. This update introduces a one-time scan that occurs when the user opens the network settings page in the UI, enables WiFi, and then opens the network list page to view available networks. Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@intel.com>
2025-06-25WifiConnectionManagerDxe: clear timers not eventsZachary Clark-Williams1-2/+4
Replace timer eventclose with scan timerset in WifiConnectionManagerDxe. This change ensures that the driver sets and manages scan timers correctly without requiring a reload when the user enables WiFi and initiates a scan for available networks. By using scan timerset directly, the driver maintains consistent behavior across WiFi sessions and avoids redundant event handling. Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@intel.com>