Skip to contentSkip to conversation

net: bootp: Make root path (option 17) length configurable

PATCH In review Andre Kalb 3 participants 3 messages Jan 28, 2022 – Aug 8, 2022 Networking

lore
Share & tools
lore

Andre Kalb

author
#0 lore raw

PATCH 1/1 net: bootp: Make root path (option 17) length configurable

to adjust the root path length.
Eg to 256 from Linux Kernel

---
 include/net.h | 2 +-
 net/Kconfig   | 6 ++++++
 net/bootp.c   | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
include/net.h +1 -1
index b02e4f630c..6f3f3dfcd4 100644
@@ -540,7 +540,7 @@ extern struct in_addr net_dns_server2;
 #endif
 extern char	net_nis_domain[32];	/* Our IS domain */
 extern char	net_hostname[32];	/* Our hostname */
-extern char	net_root_path[64];	/* Our root path */
+extern char	net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN];	/* Our root path */
 /** END OF BOOTP EXTENTIONS **/
 extern u8		net_ethaddr[ARP_HLEN];		/* Our ethernet address */
 extern u8		net_server_ethaddr[ARP_HLEN];	/* Boot server enet address */
net/Kconfig +6 -0
index 2ae9d6a020..553e271ce9 100644
@@ -123,4 +123,10 @@ config BOOTP_SERVERIP
 	  variable, not the BOOTP server. This affects the operation of both
 	  bootp and tftp.
 
+config BOOTP_MAX_ROOT_PATH_LEN
+	int "Option 17 root path length"
+	default 64
+	help
+	  Select maximal length of option 17 root path.
+
 endif   # if NET
net/bootp.c +1 -1
index d83e4eb0ba..1566fc5495 100644
@@ -64,7 +64,7 @@ ulong		bootp_start;
 ulong		bootp_timeout;
 char net_nis_domain[32] = {0,}; /* Our NIS domain */
 char net_hostname[32] = {0,}; /* Our hostname */
-char net_root_path[64] = {0,}; /* Our bootpath */
+char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN] = {0,}; /* Our bootpath */
 
 static ulong time_taken_max;
 
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 53 lines · Andre Kalb

to adjust the root path length.
Eg to 256 from Linux Kernel

---
 include/net.h | 2 +-
 net/Kconfig   | 6 ++++++
 net/bootp.c   | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
include/net.h +1 -1
index b02e4f630c..6f3f3dfcd4 100644
@@ -540,7 +540,7 @@ extern struct in_addr net_dns_server2;
 #endif
 extern char    net_nis_domain[32];     /* Our IS domain */
 extern char    net_hostname[32];       /* Our hostname */
-extern char    net_root_path[64];      /* Our root path */
+extern char    net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN];  /* Our root path */
 /** END OF BOOTP EXTENTIONS **/
 extern u8              net_ethaddr[ARP_HLEN];          /* Our ethernet address */
 extern u8              net_server_ethaddr[ARP_HLEN];   /* Boot server enet address */
net/Kconfig +6 -0
index 2ae9d6a020..553e271ce9 100644
@@ -123,4 +123,10 @@ config BOOTP_SERVERIP
          variable, not the BOOTP server. This affects the operation of both
          bootp and tftp.
 
+config BOOTP_MAX_ROOT_PATH_LEN
+       int "Option 17 root path length"
+       default 64
+       help
+         Select maximal length of option 17 root path.
+
 endif   # if NET
net/bootp.c +1 -2
index d83e4eb0ba..1566fc5495 100644
@@ -64,7 +64,7 @@ ulong         bootp_start;
 ulong          bootp_timeout;
 char net_nis_domain[32] = {0,}; /* Our NIS domain */
 char net_hostname[32] = {0,}; /* Our hostname */
-char net_root_path[64] = {0,}; /* Our bootpath */
+char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN] = {0,}; /* Our bootpath */
 
 static ulong time_taken_max;
 
--
Quoted 2 lines

2.31.1