diff mbox series

ax25: Remove CONFIG_BOOTP_SERVERIP

Message ID 20180605172100.2251-1-agraf@suse.de
State New
Headers show
Series ax25: Remove CONFIG_BOOTP_SERVERIP | expand

Commit Message

Alexander Graf June 5, 2018, 5:21 p.m. UTC
The config variable CONFIG_BOOTP_SERVERIP indicates on DHCP-TFTP fetches
that the serverip variable is supposed to be used rather than the IP of
the DHCP server that replied.

Given that in the default environment no serverip is provided, that option
does not make a lot of sense and instead breaks the default dhcp boot flow.

Let's just remove it.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 include/configs/ax25-ae350.h | 1 -
 1 file changed, 1 deletion(-)

Comments

Rick Chen June 6, 2018, 9:37 a.m. UTC | #1
> From: Alexander Graf [mailto:agraf@suse.de]
> Sent: Wednesday, June 06, 2018 1:21 AM
> To: u-boot@lists.denx.de
> Cc: Rick Jian-Zhi Chen(陳建志)
> Subject: [PATCH] ax25: Remove CONFIG_BOOTP_SERVERIP
>
> The config variable CONFIG_BOOTP_SERVERIP indicates on DHCP-TFTP fetches
> that the serverip variable is supposed to be used rather than the IP of the DHCP
> server that replied.
>
> Given that in the default environment no serverip is provided, that option does
> not make a lot of sense and instead breaks the default dhcp boot flow.
>
> Let's just remove it.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  include/configs/ax25-ae350.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/configs/ax25-ae350.h b/include/configs/ax25-ae350.h index
> b1ca5ac11a..b230896734 100644
> --- a/include/configs/ax25-ae350.h
> +++ b/include/configs/ax25-ae350.h
> @@ -11,7 +11,6 @@
>   * CPU and Board Configuration Options
>   */
>  #define CONFIG_BOOTP_SEND_HOSTNAME
> -#define CONFIG_BOOTP_SERVERIP
>
>  /*
>   * Miscellaneous configurable options
> --
> 2.12.3

Hi Alex

I have try to remove CONFIG_BOOTP_SERVERIP and verify dhcp command.
But it always fail in my test as below:

RISC-V # env print
baudrate=38400
bootdelay=3
ethact=mac@e0100000
fdtcontroladdr=3fedf290
fileaddr=600000
filesize=1bb7d34
serverip=10.0.4.97
stderr=serial@f0300000
stdin=serial@f0300000
stdout=serial@f0300000

Environment size: 303/8188 bytes

case 1

RISC-V # dhcp 0x600000 boomimage-310y-ag101p.bin
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
DHCP client bound to address 10.0.4.185 (4641 ms)
Using mac@e0100000 device
TFTP from server 255.255.255.255; our IP address is 10.0.4.185;
sending through gateway 10.0.4.254
Filename 'pxelinux.0'.
Load address: 0x600000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...

TFTP error: 'File not found' (1)
Not retrying...

TFTP error: 'File not found' (1)
Not retrying...

case 2

RISC-V # dhcp 0x600000 10.0.4.97:boomimage-310y-ag101p.bin
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
DHCP client bound to address 10.0.4.185 (4591 ms)
Using mac@e0100000 device
TFTP from server 255.255.255.255; our IP address is 10.0.4.185;
sending through gateway 10.0.4.254
Filename 'pxelinux.0'.
Load address: 0x600000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...

TFTP error: 'File not found' (1)
Not retrying...

TFTP error: 'File not found' (1)
Not retrying...
RISC-V #


But it pass with CONFIG_BOOTP_SERVERIP

RISC-V # env print

baudrate=38400

bootcmd=fatload mmc 0:1 0x20000000 ae350_64.dtb;fatload mmc 0:1 0x0
bbl-ae350.bin;go 0x0

bootdelay=3

fdtcontroladdr=3fedf290

fileaddr=600000

filesize=1bb7d34

stderr=serial@f0300000

stdin=serial@f0300000

stdout=serial@f0300000

Environment size: 260/8188 bytes

RISC-V # dhcp 0x600000 10.0.4.97:boomimage-310y-ag101p.bin

BOOTP broadcast 1

BOOTP broadcast 2

BOOTP broadcast 3

BOOTP broadcast 4

DHCP client bound to address 10.0.4.180 (4592 ms)

Using mac@e0100000 device

TFTP from server 10.0.4.97; our IP address is 10.0.4.180

Filename 'boomimage-310y-ag101p.bin'.

Load address: 0x600000

Loading: ##################

Abort

RISC-V #


Rick
Alexander Graf June 6, 2018, 11:07 a.m. UTC | #2
On 06/06/2018 11:37 AM, Rick Chen wrote:
>> From: Alexander Graf [mailto:agraf@suse.de]
>> Sent: Wednesday, June 06, 2018 1:21 AM
>> To: u-boot@lists.denx.de
>> Cc: Rick Jian-Zhi Chen(陳建志)
>> Subject: [PATCH] ax25: Remove CONFIG_BOOTP_SERVERIP
>>
>> The config variable CONFIG_BOOTP_SERVERIP indicates on DHCP-TFTP fetches
>> that the serverip variable is supposed to be used rather than the IP of the DHCP
>> server that replied.
>>
>> Given that in the default environment no serverip is provided, that option does
>> not make a lot of sense and instead breaks the default dhcp boot flow.
>>
>> Let's just remove it.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>>   include/configs/ax25-ae350.h | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/include/configs/ax25-ae350.h b/include/configs/ax25-ae350.h index
>> b1ca5ac11a..b230896734 100644
>> --- a/include/configs/ax25-ae350.h
>> +++ b/include/configs/ax25-ae350.h
>> @@ -11,7 +11,6 @@
>>    * CPU and Board Configuration Options
>>    */
>>   #define CONFIG_BOOTP_SEND_HOSTNAME
>> -#define CONFIG_BOOTP_SERVERIP
>>
>>   /*
>>    * Miscellaneous configurable options
>> --
>> 2.12.3
> Hi Alex
>
> I have try to remove CONFIG_BOOTP_SERVERIP and verify dhcp command.
> But it always fail in my test as below:
>
> RISC-V # env print
> baudrate=38400
> bootdelay=3
> ethact=mac@e0100000
> fdtcontroladdr=3fedf290
> fileaddr=600000
> filesize=1bb7d34
> serverip=10.0.4.97
> stderr=serial@f0300000
> stdin=serial@f0300000
> stdout=serial@f0300000
>
> Environment size: 303/8188 bytes
>
> case 1
>
> RISC-V # dhcp 0x600000 boomimage-310y-ag101p.bin
> BOOTP broadcast 1
> BOOTP broadcast 2
> BOOTP broadcast 3
> BOOTP broadcast 4
> DHCP client bound to address 10.0.4.185 (4641 ms)
> Using mac@e0100000 device
> TFTP from server 255.255.255.255; our IP address is 10.0.4.185;
> sending through gateway 10.0.4.254
> Filename 'pxelinux.0'.
> Load address: 0x600000
> Loading: *
> TFTP error: 'File not found' (1)
> Not retrying...
>
> TFTP error: 'File not found' (1)
> Not retrying...
>
> TFTP error: 'File not found' (1)
> Not retrying...
>
> case 2
>
> RISC-V # dhcp 0x600000 10.0.4.97:boomimage-310y-ag101p.bin
> BOOTP broadcast 1
> BOOTP broadcast 2
> BOOTP broadcast 3
> BOOTP broadcast 4
> DHCP client bound to address 10.0.4.185 (4591 ms)
> Using mac@e0100000 device
> TFTP from server 255.255.255.255; our IP address is 10.0.4.185;
> sending through gateway 10.0.4.254
> Filename 'pxelinux.0'.
> Load address: 0x600000
> Loading: *
> TFTP error: 'File not found' (1)
> Not retrying...
>
> TFTP error: 'File not found' (1)
> Not retrying...
>
> TFTP error: 'File not found' (1)
> Not retrying...
> RISC-V #
>
>
> But it pass with CONFIG_BOOTP_SERVERIP
>
> RISC-V # env print
>
> baudrate=38400
>
> bootcmd=fatload mmc 0:1 0x20000000 ae350_64.dtb;fatload mmc 0:1 0x0
> bbl-ae350.bin;go 0x0
>
> bootdelay=3
>
> fdtcontroladdr=3fedf290
>
> fileaddr=600000
>
> filesize=1bb7d34
>
> stderr=serial@f0300000
>
> stdin=serial@f0300000
>
> stdout=serial@f0300000
>
> Environment size: 260/8188 bytes
>
> RISC-V # dhcp 0x600000 10.0.4.97:boomimage-310y-ag101p.bin
>
> BOOTP broadcast 1
>
> BOOTP broadcast 2
>
> BOOTP broadcast 3
>
> BOOTP broadcast 4
>
> DHCP client bound to address 10.0.4.180 (4592 ms)
>
> Using mac@e0100000 device
>
> TFTP from server 10.0.4.97; our IP address is 10.0.4.180

I see. So this is the bug you're trying to work around ;).

I agree that the dhcp reply should not automatically overwrite the TFTP 
destination address if it's already provided. That's just plain confusing.

I can try to come up with a patch.


Alex
diff mbox series

Patch

diff --git a/include/configs/ax25-ae350.h b/include/configs/ax25-ae350.h
index b1ca5ac11a..b230896734 100644
--- a/include/configs/ax25-ae350.h
+++ b/include/configs/ax25-ae350.h
@@ -11,7 +11,6 @@ 
  * CPU and Board Configuration Options
  */
 #define CONFIG_BOOTP_SEND_HOSTNAME
-#define CONFIG_BOOTP_SERVERIP
 
 /*
  * Miscellaneous configurable options