[Buildroot] Bug report
Peter Korsgaard
peter at korsgaard.com
Tue Aug 17 10:29:08 UTC 2021
>>>>> "王琦" == 王琦 <wangwangqi2011 at gmail.com> writes:
> *Summary*: udhcpc.script file cannot assign a right action to hook files
> *Description*:
> When passing `bound` or `renew` parameter to udhcpc.script, these
> parameters are wiped out before hooking files with them. So an empty string
> passed to these hooked files, which failed to configure some necessary
> parameters.
> Following are some detailed info:
> Version of Buildroot: 2021.02.2
> Version of Busybox: 1.33.0
> File Location: package/busybox/udhcpc.script
> Description: The DHCP action is empty after the 'deconfig'. Actually, it
> should be 'bound'(or 'renew'). As a result, the hook operation at the end
> of this script will not pass the right parameters to the relevant files.
> Cause: When the condition of Line.67 is true, then Line.75 will change
> '$@', after the Line.78 shifts all the parameters, the '$@' becomes empty.
> At last, an empty '$@' is passed to the hook operation, which will cause
> problems.
> Fix: At first, store the '$@' to a variable and at last, use the variable
> instead of '$@' to get the action parameter.
> Serial Logs from GCP:
> Starting network: udhcpc: started, v1.33.0
> DHCP action="deconfig" with variables
> udhcpc: sending discover
> udhcpc: sending select for **.**.**.**
> udhcpc: lease of **.**.**.** obtained, lease time *****
> deleting routers
> route: SIOCADDRT: Invalid argument
> adding dns **.**.**.**
> DHCP action="" with variables
> OK
> From the above log, we can see obviously that the DHCP action is an empty
> string, which should be 'bound' or 'renew'.
Ahh, good catch - Fixed in git:
https://git.buildroot.net/buildroot/commit/?id=94c41eef615bb33ad26fff71d341f66e35286f5d
I will also backport it to the stable/LTS branches.
--
Bye, Peter Korsgaard
More information about the buildroot
mailing list