]> git.ipfire.org Git - thirdparty/grub.git/commit
net: fix ipv6 routing
authorJosef Bacik <jbacik@fb.com>
Wed, 10 Feb 2016 21:21:00 +0000 (13:21 -0800)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Thu, 25 Feb 2016 19:38:52 +0000 (22:38 +0300)
commiteb9f401fc1e919fa29602d4d7b9b4378338e16e9
treef3cd2d7bf46e63b2d2c876dc0daab861153bad19
parent94c56a4c65c9b2c0cb99f225fadffc2ca990c9d1
net: fix ipv6 routing

ipv6 routing in grub2 is broken, we cannot talk to anything outside our local
network or anything that doesn't route in our global namespace.  This patch
fixes this by doing a couple of things

1) Read the router information off of the router advertisement.  If we have a
router lifetime we need to take the source address and create a route from it.

2) Changes the routing stuff slightly to allow you to specify a gateway _and_ an
interface.  Since the router advertisements come in on the link local address we
need to associate it with the global address on the card.  So when we are
processing the router advertisement, either use the SLAAC interface we create
and add the route to that interface, or loop through the global addresses we
currently have on our interface and associate it with one of those addresses.
We need to have a special case here for the default route so that it gets used,
we do this by setting the masksize to 0 to mean it encompasses all networks.
The routing code will automatically select the best route so if there is a
closer match we will use that.

With this patch I can now talk to ipv6 addresses outside of my local network.
Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
grub-core/net/bootp.c
grub-core/net/drivers/ieee1275/ofnet.c
grub-core/net/icmp6.c
grub-core/net/net.c
include/grub/net.h