mbox series

[v3,0/3] net: Sanitize DHCP variable override

Message ID 20180615082929.82491-1-agraf@suse.de
Headers show
Series net: Sanitize DHCP variable override | expand

Message

Alexander Graf June 15, 2018, 8:29 a.m. UTC
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(-)