From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Michael Chang <mchang@suse.com>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH 1/3] Added net_bootp6 command
Date: Sat, 16 May 2015 08:42:45 +0300 [thread overview]
Message-ID: <20150516084245.584b6559@opensuse.site> (raw)
In-Reply-To: <20150515135728.GA12860@linux-dsax.tai.apac.novell.com>
В Fri, 15 May 2015 21:57:28 +0800
Michael Chang <mchang@suse.com> пишет:
> On Fri, May 15, 2015 at 09:26:06AM +0300, Andrei Borzenkov wrote:
> > В Tue, 12 May 2015 16:49:48 +0800
> > Michael Chang <mchang@suse.com> пишет:
> >
> > > The net_bootp6 is used to configure the ipv6 network interface through the
> > > DHCPv6 protocol Solict/Advertise/Request/Reply.
> > > ---
> > > grub-core/net/bootp.c | 895 ++++++++++++++++++++++++++++++++++++++++++++++++-
> > > grub-core/net/ip.c | 35 ++
> > > include/grub/net.h | 19 +
> > > 3 files changed, 948 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
> > > index 6136755..5c5eb6f 100644
> > > --- a/grub-core/net/bootp.c
> > > +++ b/grub-core/net/bootp.c
> > > @@ -24,6 +24,8 @@
> > > #include <grub/net/netbuff.h>
> > > #include <grub/net/udp.h>
> > > #include <grub/datetime.h>
> > > +#include <grub/time.h>
> > > +#include <grub/list.h>
> > >
> > > static void
> > > parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
> > > @@ -256,6 +258,646 @@ grub_net_configure_by_dhcp_ack (const char *name,
> > > return inter;
> > > }
> > >
> > > +struct grub_dhcpv6_option {
> > > + grub_uint16_t code;
> > > + grub_uint16_t len;
> >
> > Won't do; options in packet are unaligned (see below) so you have to
> > walk byte buffer using get_unaligned and
>
> I don't get it. Wouldn't the structure attribute GRUB_PACKED do the
> trick for us?
>
Yes, you are right. I apologize for confusion.
Sorry :(
> >
> > grub_uint8_t code[2]
> > grub_uint8_t len[2]
> >
> > > + grub_uint8_t data[0];
> > > +} GRUB_PACKED;
> > > +
> > > +
> > > +struct grub_dhcpv6_iana_option {
> > > + grub_uint32_t iaid;
> > > + grub_uint32_t t1;
> > > + grub_uint32_t t2;
> > > + grub_uint8_t data[0];
> > > +} GRUB_PACKED;
> > > +
> > > +struct grub_dhcpv6_iaaddr_option {
> > > + grub_uint8_t addr[16];
> > > + grub_uint32_t preferred_lifetime;
> > > + grub_uint32_t valid_lifetime;
> > > + grub_uint8_t data[0];
> > > +} GRUB_PACKED;
> > > +
> > > +struct grub_DUID_LL
> > > +{
> > > + grub_uint16_t type;
> > > + grub_uint16_t hw_type;
> > > + grub_uint8_t hwaddr[6];
> > > +} GRUB_PACKED;
> > > +
> >
> > Probably the same applies to all option definitions.
>
> That would require quite a lot of rewritting basically. (So I'd like it
> to be clear to me in the first).
>
next prev parent reply other threads:[~2015-05-16 5:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 8:49 [PATCH v1] Support DHCPv6 and UEFI IPv6 PXE Michael Chang
2015-05-12 8:49 ` [PATCH 1/3] Added net_bootp6 command Michael Chang
2015-05-15 6:26 ` Andrei Borzenkov
2015-05-15 13:57 ` Michael Chang
2015-05-16 5:42 ` Andrei Borzenkov [this message]
2015-05-19 8:42 ` Michael Chang
2015-05-30 7:25 ` Andrei Borzenkov
2015-05-12 8:49 ` [PATCH 2/3] UEFI IPv6 PXE support Michael Chang
2015-05-12 8:49 ` [PATCH 3/3] Update document for net_bootp6 command Michael Chang
2015-05-15 6:40 ` [PATCH v1] Support DHCPv6 and UEFI IPv6 PXE Andrei Borzenkov
2015-05-15 14:15 ` Michael Chang
-- strict thread matches above, loose matches on Subject: below --
2015-04-15 9:05 [RFC] " 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
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=20150516084245.584b6559@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
/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.