Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Talos fails to parse vlan cmdline parameter if the interface uses a VLAN_PLUS_VID form #9552

Closed
Tracked by #9249
solidDoWant opened this issue Oct 23, 2024 · 0 comments · Fixed by #9583
Closed
Tracked by #9249

Comments

@solidDoWant
Copy link
Contributor

Bug Report

Description

According to the dracut man page, there are four different forms of VLAN names:

  • VLAN_PLUS_VID (vlan0005)
  • VLAN_PLUS_VID_NO_PAD (vlan5)
  • DEV_PLUS_VID (eth0.0005)
  • DEV_PLUS_VID_NO_PAD (eth0.5)

When parsing the parameter, the parsing function assumes that the field uses either the DEV_PLUS_VID form or the DEV_PLUS_VID_NO_PAD form.

Instead, the function should do the following:

var vlanNumberString string
if strings.HasPrefix(vlanName, "vlan") {
    vlanNumberString = strings.TrimPrefix(vlanName, "vlan")
} else {
    _, vlanNumberString, ok := strings.Cut(vlanName, ".")
    if !ok {
        return settings, fmt.Errorf("malformed vlan commandline argument: %s", *vlanSettings)
    }
}

Logs

Environment

  • Talos version: v1.8.1
  • Kubernetes version: N/A
  • Platform: metal/amd64
jnohlgard added a commit to jnohlgard/talos that referenced this issue Oct 28, 2024
Fixes siderolabs#9552

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
DmitriyMV pushed a commit to jnohlgard/talos that referenced this issue Oct 28, 2024
Fixes siderolabs#9552

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
smira pushed a commit to smira/talos that referenced this issue Nov 13, 2024
Check for invalid VLAN ID numbers during cmdline parsing

Fixes siderolabs#9552

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
(cherry picked from commit 78353f7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant