Skip to contentSkip to conversation

net: lwip: dns depend on enabled protocol config instead of command

PATCH In review E Shattow 3 participants 5 messages Jul 12, 2025 – Jul 19, 2025 Networking

lore
Share & tools
lore

E Shattow

author
#0 lore raw

PATCH 1/1 net: lwip: dns depend on enabled protocol config instead of command

Allow dns when enabled CONFIG_PROT_DNS_LWIP=y CONFIG_CMD_DNS=n

Fixes a383869d6b58 ("net: lwip: move dns init to common function")
---
 net/lwip/net-lwip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/lwip/net-lwip.c +1 -1
index 3918d57d7e5..5d247c3721b 100644
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
  */
 int net_lwip_dns_init(void)
 {
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(PROT_DNS_LWIP)
 	bool has_server = false;
 	ip_addr_t ns;
 	char *nsenv;

base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace

Signature · 1 line
2.50.0
author
#1 lore raw
Quoted 22 lines · E Shattow

Allow dns when enabled CONFIG_PROT_DNS_LWIP=y CONFIG_CMD_DNS=n

Fixes a383869d6b58 ("net: lwip: move dns init to common function")
---
 net/lwip/net-lwip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/lwip/net-lwip.c +1 -1
index 3918d57d7e5..5d247c3721b 100644
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
  */
 int net_lwip_dns_init(void)
 {
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(PROT_DNS_LWIP)
 	bool has_server = false;
 	ip_addr_t ns;
 	char *nsenv;
Quoted 1 line

base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace

Postscript: There was recently a U-Boot release and the above patch only applies to origin/master (is apparently not needed or applicable to origin/next). However on origin/next there are similar troubles where DNS is disabled unless the dns command is enabled in several network commands, which is something I can test for but am not the expert to make a patch or suggestion for.

-E

#2 lore raw

Hi E,

Quoted 25 lines · E Shattow
Quoted 22 lines · E Shattow

Allow dns when enabled CONFIG_PROT_DNS_LWIP=y CONFIG_CMD_DNS=n

Fixes a383869d6b58 ("net: lwip: move dns init to common function")
---
 net/lwip/net-lwip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/lwip/net-lwip.c +1 -1
index 3918d57d7e5..5d247c3721b 100644
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
  */
 int net_lwip_dns_init(void)
 {
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(PROT_DNS_LWIP)
 	bool has_server = false;
 	ip_addr_t ns;
 	char *nsenv;
Quoted 1 line
Quoted 1 line

base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace

I think the proper way is to introduce a new "DNS" Kconfig symbol to differentiate between DNS support and the DNS command itself. PROT_DNS_LWIP should remain an internal symbol not exposed to the user and selected automatically when DNS is enabled. DNS would apply to both NET and NET_LWIP.

We already have a similar mechanism in place for WGET and CMD_WGET.

Quoted 7 lines

Postscript: There was recently a U-Boot release and the above patch only applies to origin/master (is apparently not needed or applicable to origin/next). However on origin/next there are similar troubles where DNS is disabled unless the dns command is enabled in several network commands, which is something I can test for but am not the expert to make a patch or suggestion for.

IIUC origin/next is not the proper reference at this point in the release cycle, so I would say it doesn't matter.

I will send a patch shortly to introduce CONFIG_DNS. I am currently running CI.

Regards,

Signature · 1 line
Jerome
Quoted 2 lines

-E

#3 lore raw

Hi Jerome, E,

Quoted 45 lines · Jerome Forissier

Hi E,

Quoted 25 lines · E Shattow
Quoted 22 lines · E Shattow

Allow dns when enabled CONFIG_PROT_DNS_LWIP=y CONFIG_CMD_DNS=n

Fixes a383869d6b58 ("net: lwip: move dns init to common function")
---
  net/lwip/net-lwip.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
net/lwip/net-lwip.c +1 -1
index 3918d57d7e5..5d247c3721b 100644
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice *dev, ip4_addr_t *ip,
   */
  int net_lwip_dns_init(void)
  {
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(PROT_DNS_LWIP)
  	bool has_server = false;
  	ip_addr_t ns;
  	char *nsenv;
Quoted 1 line
Quoted 1 line

base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace

I think the proper way is to introduce a new "DNS" Kconfig symbol to differentiate between DNS support and the DNS command itself. PROT_DNS_LWIP should remain an internal symbol not exposed to the user and selected automatically when DNS is enabled. DNS would apply to both NET and NET_LWIP.

We already have a similar mechanism in place for WGET and CMD_WGET.

Quoted 7 lines

Postscript: There was recently a U-Boot release and the above patch only applies to origin/master (is apparently not needed or applicable to origin/next). However on origin/next there are similar troubles where DNS is disabled unless the dns command is enabled in several network commands, which is something I can test for but am not the expert to make a patch or suggestion for.

Quoted 3 lines

IIUC origin/next is not the proper reference at this point in the release cycle, so I would say it doesn't matter.

next is pushed only after -rc2. We are currently in the merge window, so master is the target for patches, c.f. https://docs.u-boot.org/en/latest/develop/release_cycle.html#release-cycle

Cheers,
Quentin

author
#4 lore raw

Hi Quentin, Jerome,

Quoted 55 lines · Quentin Schulz

Hi Jerome, E,

Quoted 48 lines · Jerome Forissier

Hi E,

Quoted 26 lines · E Shattow
Quoted 23 lines · E Shattow

Allow dns when enabled CONFIG_PROT_DNS_LWIP=y CONFIG_CMD_DNS=n

Fixes a383869d6b58 ("net: lwip: move dns init to common function")

---
  net/lwip/net-lwip.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
net/lwip/net-lwip.c +1 -1
index 3918d57d7e5..5d247c3721b 100644
@@ -147,7 +147,7 @@ static int get_udev_ipv4_info(struct udevice
 *dev, ip4_addr_t *ip,
    */
   int net_lwip_dns_init(void)
   {
-#if CONFIG_IS_ENABLED(CMD_DNS)
+#if CONFIG_IS_ENABLED(PROT_DNS_LWIP)
       bool has_server = false;
       ip_addr_t ns;

      char *nsenv;

Quoted 1 line
Quoted 1 line

base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace

I think the proper way is to introduce a new "DNS" Kconfig symbol to differentiate between DNS support and the DNS command itself. PROT_DNS_LWIP
should remain an internal symbol not exposed to the user and selected automatically when DNS is enabled. DNS would apply to both NET and NET_LWIP.

We already have a similar mechanism in place for WGET and CMD_WGET.

Quoted 7 lines

Postscript: There was recently a U-Boot release and the above patch only applies to origin/master (is apparently not needed or applicable to origin/next). However on origin/next there are similar troubles where DNS is disabled unless the dns command is enabled in several network commands, which is something I can test for but am not the expert to make a patch or suggestion for.

Quoted 3 lines

IIUC origin/next is not the proper reference at this point in the release cycle, so I would say it doesn't matter.

Quoted 6 lines

next is pushed only after -rc2. We are currently in the merge window, so master is the target for patches, c.f. https://docs.u-boot.org/en/
latest/develop/release_cycle.html#release-cycle

Cheers,
Quentin

Acknowledged. Disregard my patch here. Thanks! -E