diff mbox series

[1/1] net: lwip: do not return CMD_RET_USAGE if no interface

Message ID 20241205193254.25807-1-heinrich.schuchardt@canonical.com
State Accepted
Commit b6691d0add999459393a19f0f02b66243ee2a4ae
Delegated to: Tom Rini
Headers show
Series [1/1] net: lwip: do not return CMD_RET_USAGE if no interface | expand

Commit Message

Heinrich Schuchardt Dec. 5, 2024, 7:32 p.m. UTC
If the dns command cannot find a network interface, we should return
CMD_RETFAIURE and not -1 (CMD_RET_USAGE).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 net/lwip/dns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jerome Forissier Dec. 5, 2024, 9:14 p.m. UTC | #1
On 12/5/24 20:32, Heinrich Schuchardt wrote:
> If the dns command cannot find a network interface, we should return
> CMD_RETFAIURE and not -1 (CMD_RET_USAGE).

CMD_RET_FAILURE

> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  net/lwip/dns.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/lwip/dns.c b/net/lwip/dns.c
> index 4b937feaee1..1de63c9998b 100644
> --- a/net/lwip/dns.c
> +++ b/net/lwip/dns.c
> @@ -56,7 +56,7 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var)
>  
>  	netif = net_lwip_new_netif(udev);
>  	if (!netif)
> -		return -1;
> +		return CMD_RET_FAILURE;
>  
>  	dns_init();
>  

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>

Thanks,
Tom Rini Dec. 19, 2024, 9:43 p.m. UTC | #2
On Thu, 05 Dec 2024 20:32:53 +0100, Heinrich Schuchardt wrote:

> If the dns command cannot find a network interface, we should return
> CMD_RETFAIURE and not -1 (CMD_RET_USAGE).
> 
> 

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/net/lwip/dns.c b/net/lwip/dns.c
index 4b937feaee1..1de63c9998b 100644
--- a/net/lwip/dns.c
+++ b/net/lwip/dns.c
@@ -56,7 +56,7 @@  static int dns_loop(struct udevice *udev, const char *name, const char *var)
 
 	netif = net_lwip_new_netif(udev);
 	if (!netif)
-		return -1;
+		return CMD_RET_FAILURE;
 
 	dns_init();