diff options
author | Tom Rini <trini@konsulko.com> | 2023-07-05 11:28:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-07-05 11:28:55 -0400 |
commit | e80f4079b3a3db0961b73fa7a96e6c90242d8d25 (patch) | |
tree | 5352d65d18b44e0982152654dc9f8018047e65ae /cmd/net.c | |
parent | 45f77b807c2f6b8da88ae897b7eb2238e25df36b (diff) | |
parent | e1bebc16e1d9aa0ddd56c53c0b781f7186dce557 (diff) |
Merge tag 'v2023.07-rc6' into next
Prepare v2023.07-rc6
Diffstat (limited to 'cmd/net.c')
-rw-r--r-- | cmd/net.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/net.c b/cmd/net.c index dfe811f41ac..d407d8320a3 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -210,7 +210,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); @@ -275,20 +275,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); } } |