[PATCH 0/2] net: DHCPv6 protocol and commands

Vyacheslav V. Mitrofanov v.v.mitrofanov at yadro.com
Sun Mar 5 12:39:00 CET 2023


> From: Sean Edmond <seanedmond at microsoft.com>
> 
> The recently integrated IPv6 patch series relies on the link-local
> address,
> or a statically assigned IPv6 address for network operations.  This
> patch
> series adds IPv6 address assignment through DHCPv6.
> 
> The implementation meets the requirements in RFC 8415 for
> "Client/Server
> Exchanges Involving Four Messages":
> https://www.rfc-editor.org/rfc/rfc8415
> 
> The implementation sends/receives the minimum required DHCPv6 options
> to
> network boot.
> 
> A new command (dhcp6) will execute the protocol.  In addition, IPv6
> functionality has been extended to the existing pxe commands ("pxe
> get"
> and "pxe boot").
> 
> Sean Edmond (2):
>   net: dhcp6: Add DHCPv6 (DHCP for IPv6)
>   net: dhcp6: pxe: Add DHCP/PXE commands for IPv6
> 
>  boot/bootmeth_distro.c |   2 +-
>  boot/bootmeth_pxe.c    |   4 +-
>  boot/pxe_utils.c       |   3 +-
>  cmd/Kconfig            |  26 ++
>  cmd/net.c              |  22 ++
>  cmd/pxe.c              |  86 ++++-
>  cmd/sysboot.c          |   2 +-
>  include/net.h          |  10 +-
>  include/net6.h         |   2 -
>  include/pxe_utils.h    |  10 +-
>  net/Makefile           |   1 +
>  net/dhcpv6.c           | 741
> +++++++++++++++++++++++++++++++++++++++++
>  net/dhcpv6.h           | 212 ++++++++++++
>  net/net.c              |  12 +
>  14 files changed, 1113 insertions(+), 20 deletions(-)
>  create mode 100644 net/dhcpv6.c
>  create mode 100644 net/dhcpv6.h
> 
> --
> 2.39.0
> 
> 


Hello! Very sorry for the long response!
I checked your patches and in general it looks good. Anyway I have made
some notes. It is up to you and maintainers to improve the code or not.


Moreover I've briefly tested it and it works.
=> dhcp6
: PHY present at 0
: Starting autonegotiation...
: Autonegotiation complete
: link up, 100Mbps full-duplex (lpa: 0x41e1)
DHCP6 SOLICIT 0
DHCP6 REQUEST 0
DHCP6 client bound to fe80:0000:0000:0000:42f2:e9ff:fe6d:beef

Notes:
1. Some comments have //-style. Better to use /**/
//global variable to track any updates from DHCP6 server 

2. If you apply only the first patch you can add to config CMD_DHCP6
but when you run u-boot it won't be available. Looks like sth
incomplete. I think it would be much better to enable CMD_DHCP6 in the
second patch when you add do_dhcp6().

3. struct dhcp6_sm_params has invalid description. You copy-passed it
from the previous func.

4. Add CMD_DHCP6 to sandbox_*_defconfig

5. if CONFIG_DHCP6_PXE_DHCP_OPTION is not configured then you will get
"cmd/pxe.c:172:1: warning: label ‘error_exit’ defined but not used"
during a build

6. How to determine IPv6 address in dhcp6 command 
=> help dhcp6
	dhcp6 [loadAddress] [[hostIPaddr:]bootfilename]

In tftpboot []-notation is used to specify IPv6

7. net_set_timeout_handler(); has prototype void
net_set_timeout_handler(ulong iv, thand_f *f). Maybe it is better to
use net_set_timeout_handler(0, NULL); than net_set_timeout_handler(0,
0); 

8. You moved #define USE_IP6_CMD_PARAM      "-ipv6" from include/net6.h
to include/net.h
I think it is better to leave IPv6 defines in net6 header.

Thanks!


More information about the U-Boot mailing list