lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Jan 2022 08:40:06 +0100
From:   Christian Gmeiner <christian.gmeiner@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     Christian Gmeiner <christian.gmeiner@...il.com>,
        Joe Hershberger <joe.hershberger@...com>,
        Ramon Fried <rfried.dev@...il.com>,
        Patrick Delaunay <patrick.delaunay@...s.st.com>,
        Heiko Schocher <hs@...x.de>,
        Roman Kovalivskyi <roman.kovalivskyi@...ballogic.com>,
        Michal Simek <michal.simek@...inx.com>, u-boot@...ts.denx.de
Subject: [PATCH] net: fastboot: make UDP port net: configurable

The fastboot protocol uses per default the UDP port 5554. In some cases
it might be needed to change the used port. The fastboot utility provides
a way to specifiy an other port number to use already.

  fastboot -s udp:192.168.1.76:1234 boot fastboot.img

Signed-off-by: Christian Gmeiner <christian.gmeiner@...il.com>
---
 drivers/fastboot/Kconfig | 7 +++++++
 net/fastboot.c           | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
index d5e4a02098..b97c67bf60 100644
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -21,6 +21,13 @@ config UDP_FUNCTION_FASTBOOT
 	help
 	  This enables the fastboot protocol over UDP.
 
+config UDP_FUNCTION_FASTBOOT_PORT
+	depends on UDP_FUNCTION_FASTBOOT
+	int "Define FASTBOOT UDP port"
+	default 5554
+	help
+	  The fastboot protocol requires a UDP port number.
+
 if FASTBOOT
 
 config FASTBOOT_BUF_ADDR
diff --git a/net/fastboot.c b/net/fastboot.c
index 7e7a601b9f..139233b86c 100644
--- a/net/fastboot.c
+++ b/net/fastboot.c
@@ -9,9 +9,6 @@
 #include <net.h>
 #include <net/fastboot.h>
 
-/* Fastboot port # defined in spec */
-#define WELL_KNOWN_PORT 5554
-
 enum {
 	FASTBOOT_ERROR = 0,
 	FASTBOOT_QUERY = 1,
@@ -310,7 +307,7 @@ void fastboot_start_server(void)
 	printf("Using %s device\n", eth_get_name());
 	printf("Listening for fastboot command on %pI4\n", &net_ip);
 
-	fastboot_our_port = WELL_KNOWN_PORT;
+	fastboot_our_port = CONFIG_UDP_FUNCTION_FASTBOOT_PORT;
 
 #if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
 	fastboot_set_progress_callback(fastboot_timed_send_info);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ