aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-01-03 09:22:47 -0500
committerTom Rini <trini@konsulko.com>2024-01-03 09:22:47 -0500
commit93a0138acbe029fba1d1255cc0b9b8700b49bdff (patch)
treefe6948c32270774f94fd1f46b0a480afaa3f9669 /net
parentdffa6d0210f57793f1e4e1e209d91ca5642e4d05 (diff)
parent80cb22c58bd9ec11e970bae84510a99171b691eb (diff)
downloadu-boot-93a0138acbe029fba1d1255cc0b9b8700b49bdff.zip
u-boot-93a0138acbe029fba1d1255cc0b9b8700b49bdff.tar.gz
u-boot-93a0138acbe029fba1d1255cc0b9b8700b49bdff.tar.bz2
Merge tag 'v2024.01-rc6' into next
Prepare v2024.01-rc6
Diffstat (limited to 'net')
-rw-r--r--net/Kconfig2
-rw-r--r--net/wget.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/net/Kconfig b/net/Kconfig
index 8c80b3a..5dff633 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -58,7 +58,7 @@ config NETCONSOLE
bool "NetConsole support"
help
Support the 'nc' input/output device for networked console.
- See README.NetConsole for details.
+ See doc/usage/netconsole.rst for details.
config IP_DEFRAG
bool "Support IP datagram reassembly"
diff --git a/net/wget.c b/net/wget.c
index 6ae2237..817c5eb 100644
--- a/net/wget.c
+++ b/net/wget.c
@@ -19,6 +19,9 @@
DECLARE_GLOBAL_DATA_PTR;
+/* The default, change with environment variable 'httpdstp' */
+#define SERVER_PORT 80
+
static const char bootfile1[] = "GET ";
static const char bootfile3[] = " HTTP/1.0\r\n\r\n";
static const char http_eom[] = "\r\n\r\n";
@@ -134,19 +137,22 @@ static void wget_send_stored(void)
int len = retry_len;
unsigned int tcp_ack_num = retry_tcp_seq_num + (len == 0 ? 1 : len);
unsigned int tcp_seq_num = retry_tcp_ack_num;
+ unsigned int server_port;
uchar *ptr, *offset;
+ server_port = env_get_ulong("httpdstp", 10, SERVER_PORT) & 0xffff;
+
switch (current_wget_state) {
case WGET_CLOSED:
debug_cond(DEBUG_WGET, "wget: send SYN\n");
current_wget_state = WGET_CONNECTING;
- net_send_tcp_packet(0, SERVER_PORT, our_port, action,
+ net_send_tcp_packet(0, server_port, our_port, action,
tcp_seq_num, tcp_ack_num);
packets = 0;
break;
case WGET_CONNECTING:
pkt_q_idx = 0;
- net_send_tcp_packet(0, SERVER_PORT, our_port, action,
+ net_send_tcp_packet(0, server_port, our_port, action,
tcp_seq_num, tcp_ack_num);
ptr = net_tx_packet + net_eth_hdr_size() +
@@ -161,14 +167,14 @@ static void wget_send_stored(void)
memcpy(offset, &bootfile3, strlen(bootfile3));
offset += strlen(bootfile3);
- net_send_tcp_packet((offset - ptr), SERVER_PORT, our_port,
+ net_send_tcp_packet((offset - ptr), server_port, our_port,
TCP_PUSH, tcp_seq_num, tcp_ack_num);
current_wget_state = WGET_CONNECTED;
break;
case WGET_CONNECTED:
case WGET_TRANSFERRING:
case WGET_TRANSFERRED:
- net_send_tcp_packet(0, SERVER_PORT, our_port, action,
+ net_send_tcp_packet(0, server_port, our_port, action,
tcp_seq_num, tcp_ack_num);
break;
}