Subject: Fw: [Bug 198297] New: Unable to add ethX to bridge if ethX.<VLAN_ID> is already present in this bridge

From: Stephen Hemminger <[email-masked]>
Date: Thu, 28 Dec 2017 09:08:14 -0800

I don't think this is ever going to work as expected.

Begin forwarded message:

Date: Thu, 28 Dec 2017 08:38:37 +0000
From: [email-masked]
To: [email-masked]
Subject: [Bug 198297] New: Unable to add ethX to bridge if ethX.<VLAN_ID> is already present in this bridge

https://bugzilla.kernel.org/show_bug.cgi?id=198297

            Bug ID: 198297
           Summary: Unable to add ethX to bridge if ethX.<VLAN_ID> is
                    already present in this bridge
           Product: Networking
           Version: 2.5
    Kernel Version: 4.14.2
          Hardware: ARM
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: [email-masked]
          Reporter: [email-masked]
        Regression: No

Kernel fails adding ethX to bridge if ethX.<VLAN_ID> is already present in this
bridge.
Steps to reproduce:
# vconfig add eth2 10
# brctl addbr br
# brctl addif br eth2.10
# brctl show
bridge name     bridge id               STP enabled     interfaces
br              8000.0024a407481a       no              eth2.10
# brctl addif br eth2
can't add eth2 to bridge br: File exists
# brctl show
bridge name     bridge id               STP enabled     interfaces
br              8000.0024a407481a       no              eth2.10

But it is ok if ethX is added before ethX.<VLAN_ID>
Steps to reproduce:
# brctl delif br eth2.10
# brctl addif br eth2
# brctl addif br eth2.10
# brctl show
bridge name     bridge id               STP enabled     interfaces
br              8000.0024a407481a       no              eth2
                                                        eth2.10

So the result is depending on order of interface addition, that does not looks
logical as for me. This works good at least in kernel 3.10.70.

From my investigation it fails in function __netdev_upper_dev_link
(net/core/dev.c) on lines:
        if (netdev_has_upper_dev(dev, upper_dev))
                return -EEXIST;
I checked source code of kernel 4.14.8 but it looks the same and I think it
also has this issue.
I'm not so good with linux kernel to fix this by myself so it would be very
nice to get a patch with fix for this issue or explanation why such behavior is
correct.

Thanks in advance,
Alex.

-- 
You are receiving this mail because:
You are the assignee for the bug.