All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Chang <mchang@suse.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 3/4] efinet: UEFI IPv6 PXE support
Date: Fri, 5 Jun 2020 10:15:52 +0800	[thread overview]
Message-ID: <20200605021552.GA3688@mercury> (raw)
In-Reply-To: <CAChj19OidHbQnfReG2OF-hbo6gCtXut6fBPaJ4kqKDDp3H6GtQ@mail.gmail.com>

On Thu, Jun 04, 2020 at 01:37:52PM +0200, Thomas Frauendorfer wrote:
> Hi,
> 
> You replace the 'unused[52]' field before dhcp_discover with 51 bytes.
> While the UEFI spec also defines the EFI_PXE_BASE_CODE_MODE struct in
> this way it also specifies that an EFI_IP_ADDRESS is 16-byte buffer
> aligned on a 4-byte boundary.

True.

> So there should probably be a grub_efi_uint8_t between tos and
> station_ip to ensure the correct alignment

You're probably right if the data type for `station_ip` is
`grub_efi_pxe_ip_address_t`, but here it is `grub_efi_ip_address_t` declared
as:

  typedef grub_uint8_t grub_efi_ip_address_t[8] __attribute__ ((aligned(4)));

So the compiler would have been taking care of the alignment already ...

By the way, I found the mentioned hunk is different to what was posted on the
list[1], which had relevant fields like this:

  grub_uint8_t using_ipv6;
  grub_uint8_t unused[16];
  grub_efi_pxe_ip_address_t station_ip;
  grub_efi_pxe_ip_address_t subnet_mask;

Maybe Javier could help to shed some light on why the change was made ? Though
I'm not against it, I'm still interested to know about it if they have any
other concern or in case anything could be missing here. :)

[1] https://lists.gnu.org/archive/html/grub-devel/2016-08/msg00003.html

Thanks,
Michael

> 
> On Thu, Jun 4, 2020 at 9:34 AM Javier Martinez Canillas
> <javierm@redhat.com> wrote:
> >
> 
> >  typedef struct grub_efi_pxe_mode
> >  {
> > -  grub_uint8_t unused[52];
> > +  grub_efi_boolean_t started;
> > +  grub_efi_boolean_t ipv6_available;
> > +  grub_efi_boolean_t ipv6_supported;
> > +  grub_efi_boolean_t using_ipv6;
> > +  grub_efi_boolean_t bis_supported;
> > +  grub_efi_boolean_t bis_detected;
> > +  grub_efi_boolean_t auto_arp;
> > +  grub_efi_boolean_t send_guid;
> > +  grub_efi_boolean_t dhcp_discover_valid;
> > +  grub_efi_boolean_t dhcp_ack_received;
> > +  grub_efi_boolean_t proxy_offer_received;
> > +  grub_efi_boolean_t pxe_discover_valid;
> > +  grub_efi_boolean_t pxe_reply_received;
> > +  grub_efi_boolean_t pxe_bis_reply_received;
> > +  grub_efi_boolean_t icmp_error_received;
> > +  grub_efi_boolean_t tftp_error_received;
> > +  grub_efi_boolean_t make_callbacks;
> > +  grub_efi_uint8_t ttl;
> > +  grub_efi_uint8_t tos;
> > +  grub_efi_ip_address_t station_ip;
> > +  grub_efi_ip_address_t subnet_mask;
> >    grub_efi_pxe_packet_t dhcp_discover;
> >    grub_efi_pxe_packet_t dhcp_ack;
> >    grub_efi_pxe_packet_t proxy_offer;
> >    grub_efi_pxe_packet_t pxe_discover;
> >    grub_efi_pxe_packet_t pxe_reply;
> > +  grub_efi_pxe_packet_t pxe_bis_reply;
> > +  grub_efi_pxe_ip_filter_t ip_filter;
> > +  grub_efi_uint32_t arp_cache_entries;
> > +  grub_efi_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
> > +  grub_efi_uint32_t route_table_entries;
> > +  grub_efi_pxe_route_entry_t route_table[GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
> > +  grub_efi_pxe_icmp_error_t icmp_error;
> > +  grub_efi_pxe_tftp_error_t tftp_error;
> >  } grub_efi_pxe_mode_t;
> >
> >  typedef struct grub_efi_pxe
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


  reply	other threads:[~2020-06-05  2:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  7:33 [PATCH 0/4] UEFI IPv6 and DHCPv6 support Javier Martinez Canillas
2020-06-04  7:33 ` [PATCH 1/4] net: read bracketed ipv6 addrs and port numbers Javier Martinez Canillas
2020-06-04  7:33 ` [PATCH 2/4] bootp: New net_bootp6 command Javier Martinez Canillas
2020-06-04  7:33 ` [PATCH 3/4] efinet: UEFI IPv6 PXE support Javier Martinez Canillas
2020-06-04 11:37   ` Thomas Frauendorfer
2020-06-05  2:15     ` Michael Chang [this message]
2020-06-05 11:39       ` Thomas Frauendorfer
2020-06-05 12:05       ` Javier Martinez Canillas
2020-06-08  3:15         ` 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=20200605021552.GA3688@mercury \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.