diff options
| author | Tom Rini <[email protected]> | 2026-05-06 08:44:55 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-06 08:44:55 -0600 |
| commit | 980f8a4589626ca2b9c6c5f74eefe72f4b5606c6 (patch) | |
| tree | 85f6976ec8145a37453ede406afc5aad72811183 /net | |
| parent | ffdce9d3fbd7c4d0d4d9f241d32ef2970ee8800b (diff) | |
| parent | 5245bdc98b9fff46e4bcec2e44e915be44824537 (diff) | |
Merge tag 'net-20260506' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20260506.
net:
- phy: dp83867: default to 2ns delay if unspecified in device-tree
- nfs: fix buffer overflow in nfs_readlink_reply()
- cpsw: Add cpsw-switch DT binding support
- phy: add common PHY polarity properties support
- phy: adin: add support for the ADIN1200 phy
- macb: support for instances with less features
- phy: mscc: add support for the VSC8572
net-lwip:
- wget: correct diagnostic output
Diffstat (limited to 'net')
| -rw-r--r-- | net/lwip/wget.c | 18 | ||||
| -rw-r--r-- | net/nfs-common.c | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/net/lwip/wget.c b/net/lwip/wget.c index 008f3b395e7..502c0faebb2 100644 --- a/net/lwip/wget.c +++ b/net/lwip/wget.c @@ -20,7 +20,6 @@ #define SERVER_NAME_SIZE 254 #define HTTP_PORT_DEFAULT 80 #define HTTPS_PORT_DEFAULT 443 -#define PROGRESS_PRINT_STEP_BYTES (100 * 1024) enum done_state { NOT_DONE = 0, @@ -178,6 +177,9 @@ static int store_block(struct wget_ctx *ctx, void *src, u16_t len) ctx->daddr += len; ctx->size += len; + if (wget_info->silent) + return 0; + pos = clamp(ctx->size, 0UL, ctx->content_len); while (ctx->hash_count < pos * 50 / ctx->content_len) { @@ -240,20 +242,18 @@ static void httpc_result_cb(void *arg, httpc_result_t httpc_result, } /* Print hash marks for the last packet received */ - while (ctx->hash_count < 49) { - putc('#'); - ctx->hash_count++; + if (!wget_info->silent) { + while (ctx->hash_count < 49) { + putc('#'); + ctx->hash_count++; + } } - puts(" "); - print_size(ctx->content_len, ""); elapsed = get_timer(ctx->start_time); if (!elapsed) elapsed = 1; if (!wget_info->silent) { - if (rx_content_len > PROGRESS_PRINT_STEP_BYTES) - printf("\n"); - printf("%u bytes transferred in %lu ms (", rx_content_len, + printf("\n%u bytes transferred in %lu ms (", rx_content_len, elapsed); print_size(rx_content_len / elapsed * 1000, "/s)\n"); printf("Bytes transferred = %lu (%lx hex)\n", ctx->size, diff --git a/net/nfs-common.c b/net/nfs-common.c index 4fbde67a760..72d8fd823e3 100644 --- a/net/nfs-common.c +++ b/net/nfs-common.c @@ -674,11 +674,15 @@ static int nfs_readlink_reply(uchar *pkt, unsigned int len) strcat(nfs_path, "/"); pathlen = strlen(nfs_path); + if (pathlen + rlen >= sizeof(nfs_path_buff)) + return -NFS_RPC_DROP; memcpy(nfs_path + pathlen, (uchar *)&rpc_pkt.u.reply.data[2 + nfsv3_data_offset], rlen); nfs_path[pathlen + rlen] = 0; } else { + if (rlen >= sizeof(nfs_path_buff)) + return -NFS_RPC_DROP; memcpy(nfs_path, (uchar *)&rpc_pkt.u.reply.data[2 + nfsv3_data_offset], rlen); |
