Breakthrough! Found the point where attempting to open an IPv6 connection was failing (debug line in core/open.c) and added an AF_INET6 socket opener to TCP. I'll probably have to do the same for UDP soon.
The kind of output I'm getting now is:
gPXE> imgfetch http://[f fc00::1]/test.bin creating xfer XFER 0xabc48 opening http URI RESOLV 0xac614 opening named socket "fc00::1" RESOLV 0xac664 attempting to resolve "fc00::1" RESOLV 0xac664 trying method NUMERIC NUMERIC 0xac6b4 attempting to resolve "fc00::1" ipv6 converting fc00::1 to an in6_addr RESOLV 0xac664 succeeded using method NUMERIC XFER 0xac61c->0xabfbc redirect XFER 0xabfbc->0xac61c close XFER 0xac61c->0xabfbc close XFER 0xabfbc opening (SOCK_STREAM,AF_INET6) socket TCP 0xac704 allocated TCP 0xac704 transitioned from CLOSED to SYN_SENT TCP 0xac704 bound to port 64065 XFER 0xac61c->0x97d98 close TCP 0xac704 timer fired in SYN_SENT for 3bf72bc6..3bf72bc6 00000000 TCP/IP sending IPv6 packet ipv6: tx IP6 0xad018 src fe80::5254:ff:fe12:3456 dest ::0 nxt_hdr 6 len 36 Neighbour cache miss: IP6 fc00::1 New neighbour cache entry: IP6 fc00::1 => Ethernet 00:00:00:00:00:00 TCP/IP sending IPv6 packet ipv6: tx IP6 0xb083c src fe80::5254:ff:fe12:3456 dest ::0 nxt_hdr 58 len 32 No entry for fc00::1
As per the schedule, this week I'll be implementing neighbour discovery protocol and some other ICMPv6 features, so it's highly likely I'll have (basic) HTTP booting working by the end of the week.
It's good to finally figure out how this part of gPXE works :).
Update, a few hours later… Packet Dumps now holds some packet dumps, and in particular now holds a valid HTTP response (albeit 404) from an IPv6 web server.
Now the real coding begins - so far it's just been a lot of patching the existing IPv6 implementation; now I will be implementing completely new code.
Update #2: had the weekly meeting and sorted through some coding style issues. Getting used to the new coding style has proved to be challenging :). I managed to get IPv6 routing working properly during/after the meeting but now remote hosts try and look up the MAC address of the gPXE host by sending Neighbour Solicit messages, which aren't handled yet. I'll work on that tomorrow - Guo-Fu gave some advice about how to make responding to Neighbour Solicit messages work.
Modified the network → transport transition in the network stack to pass a net_device object alongside the packet buffer. This will let me access the local machine's link-layer address in the ICMPv6/NDP implementation.
I sorted out all the compile issues that came as a result of that and stubbed a few NDP functions ready for implementation.
Once NDP solicits are working I'll get the relevant commits out there with a request for comments, as they change some of the fundamental prototypes in the network stack. It'll be easier to see the purpose of the changes when the changes are actually being used.
Worked on getting NDP implemented today. I managed to get responding to NDP solicit messages working, which showed that the previously reimplemented IPv6 routing code has not caused a regression.
As part of the test I pinged a gPXE host after it had autoconfigured an address for itself:
64 bytes from 2001:44b8:7222:a50::f: icmp_seq=5 ttl=255 time=15.4 ms
It's nice to see gPXE talking to the network via IPv6 now :).
The next step is to get a kernel booted via HTTP over IPv6, and then I can start working on router advertisements and configuring station addresses based on the prefix announcements (at the moment the 2001:44b8:7222:a50::/64 prefix is hardcoded for testing, but the link local address used for NDP is autoconfigured).
Commit containing today's work. (96acdca13776eb7be1525984b2609111ff6dea02)
Update: HTTP booting is working!!! Success!
Commit containing fixes that were needed for HTTP booting on my network. (fe7ef6e404ca2597c915e7a1937154ff7afddc22)
Did some more work on HTTP booting today.
First thing that I fixed up was address autoconfiguration, which now uses router advertisements to obtain a prefix to use. This allows the gPXE host to get a globally routable address without asking for it (although I will add router solicits shortly).
After this, I implemented AAAA records into DNS and set up a VPS I'm renting to use a Hurricane Electric tunnel for IPv6. It's all set up with DNS, too (IPv6 required for link).
The most important change this evening however was to fix the IPv6 routing to work on both the local network as well as the Internet. This made it possible to boot a kernel from my IPv6 test server, which worked extremely well.
Things are progressing nicely now, and I'm maintaining the pace I outlined in my project plan. It doesn't look like I'll miss the deadline on this week's milestones.
Next up this week is Router Solicit messages and finishing off ICMPv6.
Only rebased some commits into git master today.
Implemented ICMPv6 router solicits which has allowed test systems to get a usable global prefix much earlier than before. Now I can get to work on DHCPv6! :)
While I was at it, I fixed routing to work properly when a netdev is specified, which should help on multi-homed systems connected to two+ unique networked segments (ie, one prefix per NIC).
I also fixed the formatting for the router advertisement handle function, which had a mix of hard tabs and spaces, each at different tab stops.