FS#69271 - [iproute2] ip tuntap / ip link set master race condition

Attached to Project: Arch Linux
Opened by Isopod (isopod) - Sunday, 10 January 2021, 14:04 GMT
Last edited by Toolybird (Toolybird) - Wednesday, 27 September 2023, 08:13 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
ip tuntap add mode tap && sleep 1 && ip link set tap2 master br0

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Toolybird (Toolybird)
Wednesday, 27 September 2023, 08:13 GMT
Reason for closing:  No response
Comment by Isopod (isopod) - Sunday, 10 January 2021, 14:56 GMT
Alright then, since I can't edit nor delete this report, which I accidentally submitted because this software sucks, and my requests for closure have been repeatedly denied, I'm just going to paste the information here, as requested:

---

Title: [iproute2] Race condition between "ip tuntap add" and "ip link set master"
Category: Packages: Core

---

Assuming you have a bridge called `br0`, the following command should create a tap device (called `tap1`, assuming you don't have any preexisting tap devices) attached to the bridge `br0`:

ip tuntap add mode tap && ip link set tap1 master br0

Expected output of `ip link`:

27: tap1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br0 state DOWN mode DEFAULT group default qlen 1000
link/ether 06:90:1c:82:5a:64 brd ff:ff:ff:ff:ff:ff

But instead I get:

27: tap1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
link/ether ee:90:cd:bc:66:76 brd ff:ff:ff:ff:ff:ff

Notice the missing `master br0`. This used to work, and definitely *should* work, but broke after an upgrade. I currently work around this problem by inserting a sleep between the two calls:

ip tuntap add mode tap && sleep 1 && ip link set tap1 master br0

This works, but it's very inelegant and fragile.

Package version:
* iproute2 5.10.0-2
Comment by Christian Hesse (eworm) - Wednesday, 21 April 2021, 12:34 GMT
Works for me... Is this still an issue with iproute2 5.11.0-1?
Do you know if this broke with iproute2 update or any other package (like linux)?
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...