grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] net: add local route when creating link local ipv6 inter


From: Andrei Borzenkov
Subject: Re: [PATCH 2/3] net: add local route when creating link local ipv6 interface
Date: Fri, 7 Aug 2015 11:38:30 +0300

On Wed, Aug 5, 2015 at 9:36 PM, Josef Bacik <address@hidden> 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 <address@hidden>
> ---
>  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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]