diff options
author | Tom Rini | 2023-06-14 15:50:04 -0400 |
---|---|---|
committer | Tom Rini | 2023-06-14 15:50:04 -0400 |
commit | 2f4664f5c3edc55b18d8906f256a4c8e303243c0 (patch) | |
tree | 438153aa69df3c1af0dc04848b507f5a833787dd | |
parent | 19b77d3d23966a0d6dbb3c86187765f11100fb6f (diff) | |
parent | 2f7c7159ea4c0e5c2aa7671c5b5a2889d0abe7ce (diff) |
Merge branch '2023-06-14-assorted-fixes'
- Fix some issues Coverity Scan reported in IPv6, SPL EXTn support fix,
two small bootstd fixes, one Kconfig dependency fix, and fix booting
on Pinephone Pro
-rw-r--r-- | boot/Kconfig | 26 | ||||
-rw-r--r-- | boot/bootmeth_extlinux.c | 2 | ||||
-rw-r--r-- | cmd/net.c | 12 | ||||
-rw-r--r-- | common/spl/spl_ext.c | 4 | ||||
-rw-r--r-- | configs/pinephone-pro-rk3399_defconfig | 1 | ||||
-rw-r--r-- | drivers/net/Kconfig | 1 | ||||
-rw-r--r-- | net/dhcpv6.c | 5 | ||||
-rw-r--r-- | net/dhcpv6.h | 2 |
8 files changed, 30 insertions, 23 deletions
diff --git a/boot/Kconfig b/boot/Kconfig index eea5ed6040f..a643a3d1286 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -397,19 +397,6 @@ config BOOTSTD U-Boot) - bootflow - a description of how to boot (owned by the distro) -config BOOTSTD_FULL - bool "Enhanced features for standard boot" - default y if SANDBOX - help - This enables various useful features for standard boot, which are not - essential for operation: - - - bootdev, bootmeth commands - - extra features in the bootflow command - - support for selecting the ordering of bootmeths ("bootmeth order") - - support for selecting the ordering of bootdevs using the devicetree - as well as the "boot_targets" environment variable - config SPL_BOOTSTD bool "Standard boot support in SPL" depends on SPL && SPL_DM && SPL_OF_CONTROL && SPL_BLK @@ -432,6 +419,19 @@ config VPL_BOOTSTD if BOOTSTD +config BOOTSTD_FULL + bool "Enhanced features for standard boot" + default y if SANDBOX + help + This enables various useful features for standard boot, which are not + essential for operation: + + - bootdev, bootmeth commands + - extra features in the bootflow command + - support for selecting the ordering of bootmeths ("bootmeth order") + - support for selecting the ordering of bootdevs using the devicetree + as well as the "boot_targets" environment variable + config BOOTSTD_DEFAULTS bool "Select some common defaults for standard boot" depends on BOOTSTD diff --git a/boot/bootmeth_extlinux.c b/boot/bootmeth_extlinux.c index 24be0760229..6b2b8400383 100644 --- a/boot/bootmeth_extlinux.c +++ b/boot/bootmeth_extlinux.c @@ -150,7 +150,7 @@ static int extlinux_boot(struct udevice *dev, struct bootflow *bflow) info.dev = dev; info.bflow = bflow; ret = pxe_setup_ctx(&ctx, &cmdtp, extlinux_getfile, &info, true, - bflow->subdir, false); + bflow->fname, false); if (ret) return log_msg_ret("ctx", -EINVAL); diff --git a/cmd/net.c b/cmd/net.c index 68d406291ef..9e1f40a56e9 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -209,7 +209,7 @@ U_BOOT_CMD( static void netboot_update_env(void) { - char tmp[44]; + char tmp[46]; if (net_gateway.s_addr) { ip_to_string(net_gateway, tmp); @@ -274,20 +274,20 @@ static void netboot_update_env(void) if (IS_ENABLED(CONFIG_IPV6)) { if (!ip6_is_unspecified_addr(&net_ip6) || net_prefix_length != 0) { - sprintf(tmp, "%pI6c", &net_ip6); if (net_prefix_length != 0) - sprintf(tmp, "%s/%d", tmp, net_prefix_length); - + snprintf(tmp, sizeof(tmp), "%pI6c/%d", &net_ip6, net_prefix_length); + else + snprintf(tmp, sizeof(tmp), "%pI6c", &net_ip6); env_set("ip6addr", tmp); } if (!ip6_is_unspecified_addr(&net_server_ip6)) { - sprintf(tmp, "%pI6c", &net_server_ip6); + snprintf(tmp, sizeof(tmp), "%pI6c", &net_server_ip6); env_set("serverip6", tmp); } if (!ip6_is_unspecified_addr(&net_gateway6)) { - sprintf(tmp, "%pI6c", &net_gateway6); + snprintf(tmp, sizeof(tmp), "%pI6c", &net_gateway6); env_set("gatewayip6", tmp); } } diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index f117c630bfe..2bf34344391 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -28,7 +28,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image, ext4fs_set_blk_dev(block_dev, &part_info); - err = ext4fs_mount(0); + err = ext4fs_mount(part_info.size); if (!err) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("%s: ext4fs mount err - %d\n", __func__, err); @@ -82,7 +82,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image, ext4fs_set_blk_dev(block_dev, &part_info); - err = ext4fs_mount(0); + err = ext4fs_mount(part_info.size); if (!err) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("%s: ext4fs mount err - %d\n", __func__, err); diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig index 4edea88665f..e4a8beeb1ab 100644 --- a/configs/pinephone-pro-rk3399_defconfig +++ b/configs/pinephone-pro-rk3399_defconfig @@ -73,6 +73,7 @@ CONFIG_PMIC_RK8XX=y CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK8XX=y CONFIG_PWM_ROCKCHIP=y +CONFIG_RAM_ROCKCHIP_LPDDR4=y CONFIG_DM_RNG=y CONFIG_RNG_ROCKCHIP=y CONFIG_BAUDRATE=1500000 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 09039a283eb..39eee98ca79 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -633,6 +633,7 @@ config RTL8139 config RTL8169 bool "Realtek 8169 series Ethernet controller driver" + depends on PCI help This driver supports Realtek 8169 series gigabit ethernet family of PCI/PCIe chipsets/adapters. diff --git a/net/dhcpv6.c b/net/dhcpv6.c index 0d1c600632f..73a1067877c 100644 --- a/net/dhcpv6.c +++ b/net/dhcpv6.c @@ -316,6 +316,11 @@ static void dhcp6_parse_options(uchar *rx_pkt, unsigned int len) option_ptr = ((uchar *)option_hdr) + sizeof(struct dhcp6_hdr); option_len = ntohs(option_hdr->option_len); + if (option_ptr + option_len > rx_pkt + len) { + debug("Invalid option length\n"); + return; + } + switch (ntohs(option_hdr->option_id)) { case DHCP6_OPTION_CLIENTID: if (memcmp(option_ptr, sm_params.duid, option_len) diff --git a/net/dhcpv6.h b/net/dhcpv6.h index 80ca5204325..65c8e4c71d3 100644 --- a/net/dhcpv6.h +++ b/net/dhcpv6.h @@ -38,7 +38,7 @@ #define DUID_MAX_SIZE DUID_LL_SIZE /* only supports DUID-LL currently */ /* vendor-class-data to send in vendor clas option */ -#define DHCP6_VCI_STRING "U-boot" +#define DHCP6_VCI_STRING "U-Boot" #define DHCP6_MULTICAST_ADDR "ff02::1:2" /* DHCP multicast address */ |