grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chang <mchang@suse.com>
To: grub-devel@gnu.org
Subject: [PATCH 2/3] UEFI IPv6 PXE support
Date: Wed, 15 Apr 2015 17:05:08 +0800	[thread overview]
Message-ID: <1429088709-924-3-git-send-email-mchang@suse.com> (raw)
In-Reply-To: <1429088709-924-1-git-send-email-mchang@suse.com>

When system is booted from UEFI IPv6 PXE, the network interface can be
configured directly by cached DHCPv6 packet in firmware without doing it all
over again by contacting DHCP server.
---
 grub-core/net/drivers/efi/efinet.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index f171f20..b1837e3 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -257,11 +257,25 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
     if (! pxe)
       continue;
     pxe_mode = pxe->mode;
-    grub_net_configure_by_dhcp_ack (card->name, card, 0,
-				    (struct grub_net_bootp_packet *)
-				    &pxe_mode->dhcp_ack,
-				    sizeof (pxe_mode->dhcp_ack),
-				    1, device, path);
+
+    if (pxe_mode->using_ipv6)
+      {
+	grub_net_configure_by_dhcpv6_reply (card->name, card, 0,
+					    (struct grub_net_dhcpv6_packet *)
+					    &pxe_mode->dhcp_ack,
+					    sizeof (pxe_mode->dhcp_ack),
+					    1, device, path);
+	if (grub_errno)
+	  grub_print_error ();
+      }
+    else
+      {
+	grub_net_configure_by_dhcp_ack (card->name, card, 0,
+					(struct grub_net_bootp_packet *)
+					&pxe_mode->dhcp_ack,
+					sizeof (pxe_mode->dhcp_ack),
+					1, device, path);
+      }
     return;
   }
 }
-- 
1.7.3.4



  parent reply	other threads:[~2015-04-15  9:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15  9:05 [RFC] Support DHCPv6 and UEFI IPv6 PXE Michael Chang
2015-04-15  9:05 ` [PATCH 1/3] Added net_bootp6 command Michael Chang
2015-04-16 14:40   ` Andrei Borzenkov
2015-04-17  5:04     ` Michael Chang
2015-04-19  8:15       ` Andrei Borzenkov
2015-04-20  3:09         ` Michael Chang
2015-04-20  3:38           ` Andrei Borzenkov
2015-04-15  9:05 ` Michael Chang [this message]
2015-04-15  9:05 ` [PATCH 3/3] Use UEFI MAC device as default configured by net_bootp6 Michael Chang
2015-04-16 19:58   ` Andrei Borzenkov
2015-04-17  6:41     ` Michael Chang
2015-04-17  9:01       ` Andrei Borzenkov
2015-04-17  9:48 ` [RFC] Support DHCPv6 and UEFI IPv6 PXE Andrei Borzenkov
  -- strict thread matches above, loose matches on Subject: below --
2015-05-12  8:49 [PATCH v1] " Michael Chang
2015-05-12  8:49 ` [PATCH 2/3] UEFI IPv6 PXE support Michael Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429088709-924-3-git-send-email-mchang@suse.com \
    --to=mchang@suse.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).