Re: [PATCH 15/27] net: dhcp: rework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

Am 01.12.2017 um 12:22 schrieb Sascha Hauer:
> The DHCP code is a mess. It is not clear which options are sent to the
> server and which options are returned from the server. Also environment
> variables are read from and written to all over the place.
> 
> This patch cleans this up. There now is struct dhcp_req_param which is
> used for options sent to the server and struct dhcp_result which contains
> the values sent from the server. The values from the server are written
> to the barebox variables in a single place. Also it's now possible to
> call the dhcp code without modifying barebox variables at all, storing
> the result only in the dhcp result struct.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> ---
>  commands/dhcp.c |  15 +-
>  include/dhcp.h  |  22 ++-
>  net/dhcp.c      | 532 ++++++++++++++++++++++----------------------------------
>  3 files changed, 234 insertions(+), 335 deletions(-)

.......

> @@ -693,56 +516,122 @@ int dhcp(struct eth_device *edev, int retries, struct dhcp_req_param *param)
>  			printf("T ");
>  			ret = bootp_request();
>  			/* no need to check if retries > 0 as we check if != 0 */
> -			retries--;
> +			dhcp_param.retries--;
>  			if (ret)
>  				goto out1;
>  		}
>  	}
>  
> -	if (dhcp_tftpname[0] != 0) {
> -		IPaddr_t tftpserver = resolv(dhcp_tftpname);
> -		if (tftpserver)
> -			net_set_serverip_empty(tftpserver);
> -	}

Without this part tftp is not working in my network. On LEDE/OpenWrt
with web interface i can set tftp server and root path, which is done by
setting additional DHCP options:
66,192.168.1.100
17,192.168.1.100

Adding "54,192.168.1.100" to overwrite serverip is not working.

I'm not sure what is the proper way to fix it.
-- 
Regards,
Oleksij

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux