diff options
author | Thomas Huth <thuth@redhat.com> | 2016-01-14 00:10:39 +0100 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-01-14 11:26:23 +1100 |
commit | 056ff5b32d5a33d47beb0598b5df02f913518e43 (patch) | |
tree | 14f1f70cf318a90d2dc556b63a3b04b4ab2d2d05 /clients | |
parent | 82660c5da448a9768d203f167ba88038ee2c579a (diff) | |
download | SLOF-056ff5b32d5a33d47beb0598b5df02f913518e43.zip SLOF-056ff5b32d5a33d47beb0598b5df02f913518e43.tar.gz SLOF-056ff5b32d5a33d47beb0598b5df02f913518e43.tar.bz2 |
net-snk: Allow stateless autoconfig IPv6 addresses with IP_INIT_IPV6_MANUAL
When manually specifying the TFTP server address and boot file name
in IPv6 mode, we can still get the client IPv6 address via link-local
or stateless IPv6 address autoconfiguration. So the netboot should
not abort if just the client IPv6 address has not been specified yet.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'clients')
-rw-r--r-- | clients/net-snk/app/netapps/netboot.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clients/net-snk/app/netapps/netboot.c b/clients/net-snk/app/netapps/netboot.c index 7edc35f..7ed82aa 100644 --- a/clients/net-snk/app/netapps/netboot.c +++ b/clients/net-snk/app/netapps/netboot.c @@ -486,10 +486,8 @@ netboot(int argc, char *argv[]) } } else if (ip_version == 6) { - if (memcmp(&obp_tftp_args.ci6addr, null_ip6, 16) != 0 - && memcmp(&obp_tftp_args.si6addr, null_ip6, 16) != 0 + if (memcmp(&obp_tftp_args.si6addr, null_ip6, 16) != 0 && obp_tftp_args.filename[0] != 0) { - memcpy(&fn_ip.server_ip6.addr[0], &obp_tftp_args.si6addr.addr, 16); obp_tftp_args.ip_init = IP_INIT_IPV6_MANUAL; @@ -523,7 +521,16 @@ netboot(int argc, char *argv[]) obp_tftp_args.bootp_retries, F_IPV6); break; case IP_INIT_IPV6_MANUAL: - set_ipv6_address(fn_ip.fd, &obp_tftp_args.ci6addr); + if (memcmp(&obp_tftp_args.ci6addr, null_ip6, 16)) { + set_ipv6_address(fn_ip.fd, &obp_tftp_args.ci6addr); + } else { + /* + * If no client address has been specified, then + * use a link-local or stateless autoconfig address + */ + set_ipv6_address(fn_ip.fd, NULL); + memcpy(&fn_ip.own_ip6, get_ipv6_address(), 16); + } break; case IP_INIT_DEFAULT: rc = dhcp(ret_buffer, &fn_ip, obp_tftp_args.bootp_retries, 0); |