Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZN3Yu-0006Ss-0I for mharc-grub-devel@gnu.org; Wed, 05 Aug 2015 14:37:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3Yp-0006J4-SG for grub-devel@gnu.org; Wed, 05 Aug 2015 14:37:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZN3Ym-0002p8-MZ for grub-devel@gnu.org; Wed, 05 Aug 2015 14:37:07 -0400 Received: from 66-220-155-178.intmwg.facebook.com ([66.220.155.178]:38845 helo=mx-out.facebook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3Ym-0002oz-JC for grub-devel@gnu.org; Wed, 05 Aug 2015 14:37:04 -0400 Received: from facebook.com (2401:db00:2040:5012:face:0:9:0) by mx-out.facebook.com (10.223.101.97) with ESMTP id 7d8f3ede3b9a11e5906124be0595f910-737fd2b0 for ; Wed, 05 Aug 2015 10:50:42 -0700 Received: by devbig041.ash4.facebook.com (Postfix, from userid 8730) id 26D81454205C; Wed, 5 Aug 2015 10:50:42 -0700 (PDT) From: Josef Bacik To: grub-devel@gnu.org, mchang@suse.com, pjones@redhat.com, kernel-team@fb.com Subject: [PATCH 2/3] net: add local route when creating link local ipv6 interface Date: Wed, 5 Aug 2015 10:50:39 -0700 Message-Id: <1438797040-1667541-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1438797040-1667541-1-git-send-email-jbacik@fb.com> References: <1438797040-1667541-1-git-send-email-jbacik@fb.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 66.220.155.178 Cc: Josef Bacik 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: Wed, 05 Aug 2015 18:37:09 -0000 In order to talk to link local ipv6 addresses we need to have a route out of the link local interface for this to work. Thanks, Signed-off-by: Josef Bacik --- grub-core/net/net.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 21a4e94..f96297a 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -297,7 +297,9 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, struct grub_net_network_level_interface *inf; char *name; char *ptr; + grub_err_t err; grub_net_network_level_address_t addr; + grub_net_network_level_netaddress_t netaddr; name = grub_malloc (grub_strlen (card->name) + GRUB_NET_MAX_STR_HWADDR_LEN @@ -325,7 +327,17 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, ptr += grub_strlen (ptr); } ptr = grub_stpcpy (ptr, ":link"); - return grub_net_add_addr_real (name, card, &addr, hwaddr, 0); + inf = grub_net_add_addr_real (name, card, &addr, hwaddr, 0); + if (!inf) + return NULL; + netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + netaddr.ipv6.base[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48); + netaddr.ipv6.base[1] = 0; + netaddr.ipv6.masksize = 64; + err = grub_net_add_route (name, netaddr, inf); + if (err != GRUB_ERR_NONE) + return NULL; + return inf; } /* FIXME: allow to specify mac address. */ -- 1.8.5.6