FS#69272 - [iproute2] Race condition between "ip tuntap add" and "ip link set master"

Attached to Project: Arch Linux
Opened by Isopod (isopod) - Sunday, 10 January 2021, 14:21 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 10 January 2021, 14:23 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

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
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 10 January 2021, 14:23 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#69271 

Loading...