On Wed, Aug 5, 2015 at 9:36 PM, Josef Bacik <jba...@fb.com> wrote: > 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 <jba...@fb.com> > --- > 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);
In case of multiple active interfaces it effectively directs all link-local traffic to one interface only. It does not sound right. Link-local is link local by definition so we do not really need routing table at all; but we do need to know via which card to send it. For the case of single active card we do not have choice, so can proceed directly to sending. For multiple active cards one possibility is to start neighbor detection for link-local on all configured cards. Another to add explicit host route to each received address pointing to interface via which it was receieved. > + if (err != GRUB_ERR_NONE) > + return NULL; > + return inf; > } > > /* FIXME: allow to specify mac address. */ > -- > 2.1.0 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel