Hi,

I am trying to enable PXEv6 support in OvmfPkg. The new boot option showed
as expected after the drivers in NetworkPkg are included. However, the boot
image was never fetched after DHCPv6 server assigned an IPv6 address to the
client. I digged into NetworkPkg and found it failed to get the gateway
address in PxeBcCheckRouteTable() so a timeout was issued.

My network setup is very simple:

[Linux HOST] <--> (tap0) <--> [Linux VM]

In this case, the host and VM connect to each other directly, so it seems
not necessary to setup the gateway.

I checked the git commit, the function was introduced in ae97201c to support
PXEv6 cross subnet. I wrote a patch to allow the route table check fail and
it works for me.

Cheers,

Gary Lin
>From d6c2266eaa09ca47ad2644b74afb4eab45ad32a0 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <g...@suse.com>
Date: Wed, 17 Dec 2014 15:37:40 +0800
Subject: [PATCH] NetworkPkg: make the route table check failure non-fatal

The gateway is not necessary in a simple PXE network and the
timeout of the route table check is not critical in this case.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <g...@suse.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
index 111224c..4588cc1 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c
@@ -1381,6 +1381,7 @@ PxeBcRegisterIp6Address (
   EFI_STATUS                       Status;
   UINT64                           DadTriggerTime;
   EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS    DadXmits;
+  BOOLEAN                          NoGateway;
 
   Status     = EFI_SUCCESS;
   TimeOutEvt = NULL;
@@ -1388,6 +1389,7 @@ PxeBcRegisterIp6Address (
   DataSize   = sizeof (EFI_IP6_CONFIG_POLICY);
   Ip6Cfg     = Private->Ip6Cfg;
   Ip6        = Private->Ip6;
+  NoGateway  = FALSE;
 
   ZeroMem (&CfgAddr, sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS));
   CopyMem (&CfgAddr.Address, Address, sizeof (EFI_IPv6_ADDRESS));
@@ -1402,7 +1404,7 @@ PxeBcRegisterIp6Address (
   //
   Status = PxeBcCheckRouteTable (Private, PXEBC_IP6_ROUTE_TABLE_TIMEOUT, &GatewayAddr);
   if (EFI_ERROR (Status)) {
-    goto ON_EXIT;
+    NoGateway = TRUE;
   }
   
   //
@@ -1503,7 +1505,7 @@ PxeBcRegisterIp6Address (
   //
   // Set the default gateway address back if needed.
   //
-  if (!NetIp6IsUnspecifiedAddr (&GatewayAddr)) {
+  if (NoGateway == FALSE && !NetIp6IsUnspecifiedAddr (&GatewayAddr)) {
     Status = Ip6Cfg->SetData (
                        Ip6Cfg,
                        Ip6ConfigDataTypeGateway,
-- 
2.1.2

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to