]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: ipconfig: Don't override command-line hostnames or domains
authorJosh Triplett <josh@joshtriplett.org>
Wed, 2 Jun 2021 01:38:41 +0000 (18:38 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 15 Jul 2021 17:27:30 +0000 (19:27 +0200)
commit0ace4bcd418d2b0e33445739c83d33ad8f9aec7f
treeac191d832cb3ac7e455eda250e03014f60bc5fd3
parentfb9072cb732f7b21bb6663c80ebdf32ba2fddf8e
net: ipconfig: Don't override command-line hostnames or domains

BugLink: https://bugs.launchpad.net/bugs/1933851
[ Upstream commit b508d5fb69c2211a1b860fc058aafbefc3b3c3cd ]

If the user specifies a hostname or domain name as part of the ip=
command-line option, preserve it and don't overwrite it with one
supplied by DHCP/BOOTP.

For instance, ip=::::myhostname::dhcp will use "myhostname" rather than
ignoring and overwriting it.

Fix the comment on ic_bootp_string that suggests it only copies a string
"if not already set"; it doesn't have any such logic.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/ipv4/ipconfig.c