Re: [PATCH 06/21] net: dhcp: Do not overwrite serverip if it is valid

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

 



Hi Sasha.

>  }
>  
> -void net_set_serverip(IPaddr_t ip)
> +void net_set_serverip(IPaddr_t ip, bool overwrite)
>  {
> +	if (net_serverip && !overwrite)
> +		return;
> +
>  	net_serverip = ip;
>  }

An alternative solution had been to implement two functions:
net_set_serverip() - that would always set the ip.
net_set_empty_serverip() - update ip only if empty

This is more readable than a boolean flag which
you always need to look up to check the interpretation of.

	Sam

_______________________________________________
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