tinkerbell / hook

In-memory Operating System Installation Environment for Executing Tinkerbell Workflows
Apache License 2.0
102 stars 49 forks source link

Possible Bug In VLAN parsing #180

Closed dvintel closed 1 year ago

dvintel commented 1 year ago

On line: https://github.com/tinkerbell/hook/blob/1c438a9b6dbd72a5611c54a0b60bd0dfc8a87888/files/dhcp.sh#L14C19-L14C50

The command:

sed -n 's/.*vlan_id=\([0-9]*\).*/\1/p' /proc/cmdline

will also match the string: testvlan_id=2.

I am expecting that it would only match on vlan_id=2 Note: only match on vlan_id= rather than also on testvlan_id=

dvintel commented 1 year ago

One possible solution would be to change the sed command to something like:

's/.* vlan_id=\([0-9]*\).*/\1/p'

add a space before the vlan_id=

jacobweinstock commented 1 year ago

Hey @dvintel, thanks for finding and reporting this! I've opened #181 to resolve this. Thanks!