openwrt / openwrt/netifd

netifd fails to recover existing VLAN device after daemon restart

Open
#75 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
37
Forks
62
PR merge metrics
No merged PRs in 30d

Description

Description
When netifd is restarted while a VLAN device already exists in the kernel, it fails to bring the VLAN interface back up.

This happens because vlandev_set_up() directly calls system_vlandev_add() without handling the case where the VLAN netdev already exists. As a result, system_vlandev_add() fails and the interface remains down.

Environment
OpenWrt version: (2512)
netifd version / commit: (2025.10.20)
Kernel version: (6.12)
Platform: (Airoha7581)

Steps to reproduce

  1. Configure a VLAN interface (example: eth1.100)
  2. Boot system normally → VLAN interface is up and working
  3. Kill netifd:
    killall netifd
  4. netifd is automatically restarted
  5. Observe that VLAN interface is not properly brought up
Image Image

Observed behavior
The VLAN device (e.g. eth1.100) still exists in kernel after netifd killed or restart
netifd attempts to create it again and fails
Interface remains down
this is the complete log document about restart the netfid
Relevant log:

system_vlandev_add: Error adding vlandev 'eth1.100' over 'eth1': -6
device_claim: claim 8021q eth1.100 failed: -6

log.txt
Workaround
Manually deleting the existing VLAN device allows netifd to recover:

ip link del eth1.100

After this, netifd successfully creates and brings up the interface again.
Additional notes

This issue can be consistently reproduced and is not configuration-dependent.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with vlandev_set_up() and system_vlandev_add(), then reproduce the netifd restart sequence with an existing VLAN device and inspect the reported claim errors. Done means an existing VLAN such as eth1.100 is recovered and brought up after restart without manually deleting it.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.