mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH] net: dhcp: make tftp work again
Date: Sat,  9 Dec 2017 10:31:44 +0100	[thread overview]
Message-ID: <20171209093144.21281-1-linux@rempel-privat.de> (raw)

This regression was introduced by the patch "net: dhcp: rework"
My patch should restore previous behavior where tftp server name
will overwrite serverip if the first one is present.

On most consumer devices users don't have enough control to set
DHCP as needed. At least on LEDE/OpenWRT we can configure extra
fields by adding for example "66,192.168.1.100" to set tftp server name.
At the same time, DHCP, DNS and Gateware are provided by 192.168.1.1.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 net/dhcp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/dhcp.c b/net/dhcp.c
index 76dab5ef5..18f347d2f 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -574,14 +574,14 @@ int dhcp_set_result(struct eth_device *edev, struct dhcp_result *res)
 	if (res->domainname)
 		net_set_domainname(res->domainname);
 
-	if (res->serverip) {
-		net_set_serverip_empty(res->serverip);
-	} else if (res->tftp_server_name) {
+	if (res->tftp_server_name) {
 		IPaddr_t ip;
 
 		ip = resolv(res->tftp_server_name);
 		if (ip)
 			net_set_serverip_empty(ip);
+	} else if (res->serverip) {
+		net_set_serverip_empty(res->serverip);
 	}
 
 	return 0;
-- 
2.14.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-12-09  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09  9:31 Oleksij Rempel [this message]
2017-12-12  7:44 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171209093144.21281-1-linux@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox