attempts to rename vlans / vlans have addr_assign_type of 0 on kernel 4.4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Kleber Sacilotto de Souza | ||
Yakkety |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* When vlan interfaces are created, their mac address is copied from the underlying interface, but it is not marked by kernel as stolen.
* When underlying interface MAC address is changed, it does not propagate to the vlan interfaces.
[Test Case]
* Create vlan interface, check the addr_assign_type sysfs attribute, it should be 2, not 0.
* Update the base interface mac address, the mac address of the vlan interface should change too.
* cloud-init test case
wget https:/
chmod 755 get-proposed-
for release in xenial yakkety zesty; do
./get-
MODE=vlan ./btest-launch.sh $release-
# ubuntu/passw0rd
python3 -c 'from cloudinit.net import get_interfaces_
done
[Regression Potential]
* Userspace may rely on non-propagating MAC addresses, and the fact that vlan mac address type is wrongly stated as non-stolen; however this behaviour will be consistent with 4.7+ kernels.
[Other Info]
* Please cherrypick 308453aa9156a3b
commit 308453aa9156a3b
Author: Mike Manning <email address hidden>
Date: Fri May 27 17:45:07 2016 +0100
vlan: Propagate MAC address to VLANs
The MAC address of the physical interface is only copied to the VLAN
when it is first created, resulting in an inconsistency after MAC
address changes of only newly created VLANs having an up-to-date MAC.
The VLANs should continue inheriting the MAC address of the physical
interface until the VLAN MAC address is explicitly set to any value.
This allows IPv6 EUI64 addresses for the VLAN to reflect any changes
to the MAC of the physical interface and thus for DAD to behave as
expected.
Signed-off-by: Mike Manning <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
* Original bug report
When attempting to verify sru for bug 1669860, I found that vlans
are not properly filtered out by 'get_interfaces
that the bug is still present with vlans.
The reason for this is that /sys/class/
shows '0' for a vlan on 4.4, but (correctly) shows '2' on 4.8.
See https:/
for doc on addr_assign_type.
Related bugs:
* bug 1669860: cloud-init attempts to rename bonds
Related branches
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
- Ryan Harper: Pending requested
-
Diff: 91 lines (+34/-3)2 files modifiedcloudinit/net/__init__.py (+7/-0)
tests/unittests/test_net.py (+27/-3)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
summary: |
- attempts to rename vlans / get_interfaces_by_mac does not filter vlans + attempts to rename vlans / vlans have addr_assign_type of 2 |
summary: |
- attempts to rename vlans / vlans have addr_assign_type of 2 + attempts to rename vlans / vlans have addr_assign_type of 0 on kernel + 4.4 |
Changed in cloud-init (Ubuntu): | |
status: | New → Confirmed |
Changed in linux (Ubuntu): | |
status: | New → Fix Released |
description: | updated |
Changed in linux (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: patch |
description: | updated |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Zesty): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Xenial): | |
status: | Triaged → In Progress |
Changed in linux (Ubuntu Yakkety): | |
status: | New → Fix Released |
Changed in linux (Ubuntu Zesty): | |
status: | New → Fix Released |
Changed in linux (Ubuntu Xenial): | |
assignee: | Canonical Kernel (canonical-kernel) → Kleber Sacilotto de Souza (kleber-souza) |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
Changed in linux (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
It seems that this only reproduces on kernel 4.8, but does on 4.4. net/<name> /addr_assign_ type).
The change put in to ignore certain nics was done based on 'addr_assign_type'
(/sys/class/
On 4.4 for a vlan, that shows as '0', (permanent address).
On 4.8, it (correctly) shows as '2' (stolen from another device)
To recreate this you can run the attached script.
$ MODE=vlan ./btest-launch.sh yakkety- server- cloudimg- amd64-proposed. img
...log in as ubuntu:password ...
Note, I can see this fail on xenial with 0.7.9-90- g61eb03fe- 0ubuntu1~ 16.04.1
but cannot see it fail in yakkety I
## xenial by_mac; print(get_ interfaces_ by_mac( ))' python3/ dist-packages/ cloudinit/ net/__init_ _.py", line 403, in get_interfaces_ by_mac
$ uname -r
4.4.0-72-generic
$ python3 -c 'from cloudinit.net import get_interfaces_
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/
(name, ret[mac], mac))
RuntimeError: duplicate mac found! both 'interface1.108' and 'interface1' have mac '52:54:00:12:34:02'
$ grep -r . /sys/class/net/*/ 2>/dev/null | grep addr_assign_type net/interface0/ addr_assign_ type:0 net/interface1/ addr_assign_ type:0 net/interface1. 108/addr_ assign_ type:0 net/lo/ addr_assign_ type:0
/sys/class/
/sys/class/
/sys/class/
/sys/class/
### yakkety by_mac; print(get_ interfaces_ by_mac( ))' 00:00:00: 00': 'lo', '52:54: 00:12:34: 00': 'interface0', '52:54: 00:12:34: 02': 'interface1'}
$ python3 -c 'from cloudinit.net import get_interfaces_
{'00:00:
$ uname -r
4.8.0-46-generic
$ grep -r . /sys/class/net/*/ 2>/dev/null | grep addr_assign_type net/interface0/ addr_assign_ type:0 net/interface1/ addr_assign_ type:0 net/interface1. 108/addr_ assign_ type:2 net/lo/ addr_assign_ type:0
/sys/class/
/sys/class/
/sys/class/
/sys/class/