From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YtUsB-0000gV-AR for mharc-grub-devel@gnu.org; Sat, 16 May 2015 01:42:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtUs8-0000fZ-JO for grub-devel@gnu.org; Sat, 16 May 2015 01:42:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtUs5-0001Xa-DN for grub-devel@gnu.org; Sat, 16 May 2015 01:42:52 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:36343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtUs5-0001XK-5P for grub-devel@gnu.org; Sat, 16 May 2015 01:42:49 -0400 Received: by lagv1 with SMTP id v1so150522407lag.3 for ; Fri, 15 May 2015 22:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=LjcakTsSu2ADjehjO1hsFOzrfjBY/Pl+teug5MTI1kg=; b=uT31uFnEm7pERJgVJ4QtmfqNKsET3XU5vqykQeEkY969krqO+OtWvMlGIY9QkGfUwh 7nJpEhQ0I5KRGQdjx8zPZ/yi5EWKi8POWt0eNo7n8BuAvqcLB8LJl0m1u7vRnFt+i3v+ 2KoT3rIQYjSFaOYWPM/+VnFOiNHUFiHI6LeVbkOT6MDOJ0OnvgJ3QUI6Tjv3f6/sCUS3 zXICdYuCy3uH2aOivJ90PXMrH7xcw2YlRffsxYY+CrWUacMIuchcrsqgmPN++fk0i2LR 7ofAiECFx3ZA260tLtOzHZMeg0iwxO3lnnL+WKk0lWYHQXTDGx+BIqcBCn8V0fP9nGKa taCA== X-Received: by 10.152.3.33 with SMTP id 1mr9740466laz.109.1431754968232; Fri, 15 May 2015 22:42:48 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id ks6sm930080lac.1.2015.05.15.22.42.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 22:42:47 -0700 (PDT) Date: Sat, 16 May 2015 08:42:45 +0300 From: Andrei Borzenkov To: Michael Chang Subject: Re: [PATCH 1/3] Added net_bootp6 command Message-ID: <20150516084245.584b6559@opensuse.site> In-Reply-To: <20150515135728.GA12860@linux-dsax.tai.apac.novell.com> References: <1431420590-7245-1-git-send-email-mchang@suse.com> <1431420590-7245-2-git-send-email-mchang@suse.com> <20150515092606.3efdf89e@opensuse.site> <20150515135728.GA12860@linux-dsax.tai.apac.novell.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22c Cc: grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2015 05:42:53 -0000 =D0=92 Fri, 15 May 2015 21:57:28 +0800 Michael Chang =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Fri, May 15, 2015 at 09:26:06AM +0300, Andrei Borzenkov wrote: > > =D0=92 Tue, 12 May 2015 16:49:48 +0800 > > Michael Chang =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >=20 > > > The net_bootp6 is used to configure the ipv6 network interface throug= h 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(-) > > >=20 > > > 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 > > > #include > > > #include > > > +#include > > > +#include > > > =20 > > > static void > > > parse_dhcp_vendor (const char *name, const void *vend, int limit, in= t *mask) > > > @@ -256,6 +258,646 @@ grub_net_configure_by_dhcp_ack (const char *nam= e, > > > return inter; > > > } > > > =20 > > > +struct grub_dhcpv6_option { > > > + grub_uint16_t code; > > > + grub_uint16_t len; > >=20 > > Won't do; options in packet are unaligned (see below) so you have to > > walk byte buffer using get_unaligned and >=20 > I don't get it. Wouldn't the structure attribute GRUB_PACKED do the > trick for us? >=20 Yes, you are right. I apologize for confusion. Sorry :( > >=20 > > grub_uint8_t code[2] > > grub_uint8_t len[2] > >=20 > > > + 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; > > > + > >=20 > > Probably the same applies to all option definitions. >=20 > That would require quite a lot of rewritting basically. (So I'd like it > to be clear to me in the first). >=20