Skip to content

net: Sanitize DHCP variable override

Alexander Graf u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesIn review
  2. v23 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- also check for net_boot_file_name_explicit on option 67

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: Prefer command line argumentscmd/net.c include/net.h net/bootp.c +1 more+21 -72 replies
2/3net: Add option to prefer bootp/dhcp serveripcmd/Kconfig net/bootp.c+17 -12 replies
3/3ax25: Switch to CONFIG_BOOTP_PREFER_SERVERIPconfigs/ax25-ae350_defconfig include/configs/ax25-ae350.h+1 -13 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJoe HershbergerRick Chen
1/3A-b
2/3A-b
3/3A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 0/3] net: Sanitize DHCP variable override

While trying to boot from network on a RISC-V AX25 platform, I saw that the DHCP IP address did not get populated from the DHCP server IP address. The reason for that was simple: CONFIG_BOOTP_SERVERIP was set.

I don't know the history of that option, but it seems to decrease intuitivity levels of the dhcp command rather than improve it.

What I usually would expect is that explicitly set values populate through all layers. So if I set a TFTP file name, it populates. If I set a target IP address, it populates. If I don't set anything, the values get filled in automatically.

This patch set is trying to move us into that direction without breaking people that rely on the existing behavior. With this patch set applied, boards have the option to prefer the 'serverip' environment variable (ax25-ae350 gets moved to it) over the DHCP given address and any value explicitly set on the command line is always preferred.

This hopefully makes the command line a bit more intuitive.

v1 -> v2:

- new patch: net: Prefer command line arguments
- remove README entry
- improve Kconfig help texts

v2 -> v3:

- also check for net_boot_file_name_explicit on option 67

Alexander Graf (3):
net: Prefer command line arguments
net: Add option to prefer bootp/dhcp serverip
ax25: Switch to CONFIG_BOOTP_PREFER_SERVERIP

 cmd/Kconfig                  | 11 +++++++++++
 cmd/net.c                    | 10 ++++++++--
 configs/ax25-ae350_defconfig |  1 +
 include/configs/ax25-ae350.h |  1 -
 include/net.h                |  2 ++
 net/bootp.c                  | 21 +++++++++++++++------
 net/net.c                    |  2 ++
 7 files changed, 39 insertions(+), 9 deletions(-)
Signature · 1 line
2.12.3