diff options
| author | Tom Rini <[email protected]> | 2026-06-23 10:36:58 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-06-23 10:36:58 -0600 |
| commit | 4edbb6fb600a0f657e74a9bc47e0d314e059cef8 (patch) | |
| tree | a87e57ed546c7838f7be897824b12dbfb9f1efdc /cmd | |
| parent | f072620dc9ffda00b010783da27c41231c3a439b (diff) | |
| parent | 91d5e0ee3e857c76bb05f0c69c21f3d4a150a2e6 (diff) | |
Merge tag 'net-20260623' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20260623.
net:
- airoha_eth: fix mt7531 mdio related initialization bug
net-legacy:
- cdp: reject CDP TLVs with a length below the 4-byte header
- Clear IP defragmentation state after returning a complete packet
net-lwip:
- Halt ethernet after network commands
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/lwip/ping.c | 19 | ||||
| -rw-r--r-- | cmd/lwip/sntp.c | 10 |
2 files changed, 19 insertions, 10 deletions
diff --git a/cmd/lwip/ping.c b/cmd/lwip/ping.c index fc4cf7bde5f..98fa8e22bce 100644 --- a/cmd/lwip/ping.c +++ b/cmd/lwip/ping.c @@ -163,6 +163,7 @@ static int ping_loop(struct udevice *udev, const ip_addr_t *addr) int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { ip_addr_t addr; + int ret; if (argc < 2) return CMD_RET_USAGE; @@ -171,13 +172,15 @@ int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_USAGE; net_try_count = 1; -restart: - if (net_lwip_eth_start() < 0 || ping_loop(eth_get_dev(), &addr) < 0) { - if (net_start_again() == 0) - goto restart; - else - return CMD_RET_FAILURE; - } - return CMD_RET_SUCCESS; + do { + if (net_lwip_eth_start() == 0) { + ret = ping_loop(eth_get_dev(), &addr); + net_lwip_eth_stop(); + if (ret == 0) + return CMD_RET_SUCCESS; + } + } while (net_start_again() == 0); + + return CMD_RET_FAILURE; } diff --git a/cmd/lwip/sntp.c b/cmd/lwip/sntp.c index 608345c873b..5fa400b104a 100644 --- a/cmd/lwip/sntp.c +++ b/cmd/lwip/sntp.c @@ -101,6 +101,7 @@ int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) ip_addr_t *srvip; char *server; ip_addr_t ipaddr; + int ret = CMD_RET_FAILURE; switch (argc) { case 1: @@ -127,7 +128,12 @@ int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_FAILURE; if (sntp_loop(eth_get_dev(), srvip) < 0) - return CMD_RET_FAILURE; + goto out; + + ret = CMD_RET_SUCCESS; + +out: + net_lwip_eth_stop(); - return CMD_RET_SUCCESS; + return ret; } |
