Ignore non permanenet addresses in udev too

Glean already ignores any interface in sysfs without a permanent address
type. It does this because interfaces with other address types are
likely managed by some other system running on the host like a neutron
agent. Add this exclusion check to the glean udev rules so that we don't
even run glean at all against them.

We have left the check in glean itself as a belts and suspenders check.

Change-Id: I893c873b047a24c0aecd6e2eb49d3f531a71f1b8
This commit is contained in:
Clark Boylan 2016-09-13 10:21:47 -07:00
parent 66ec92bc4e
commit 0e3b85f4c4
2 changed files with 5 additions and 2 deletions

View File

@ -740,7 +740,10 @@ def get_sys_interfaces(interface, args):
mac_addr_type = open(
'%s/%s/addr_assign_type' % (sys_root, iface), 'r').read().strip()
# TODO why? is it not valid to configure randomly assigned mac addrs?
# Interfaces without a permanent address are likely created by some
# other system on the host like a running neutron agent. In these cases
# that system should be responsible for configuring the interface not
# glean.
if mac_addr_type != PERMANENT_ADDR_TYPE:
continue
mac = open('%s/%s/address' % (sys_root, iface), 'r').read().strip()

View File

@ -1 +1 @@
SUBSYSTEM=="net", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="glean@$name.service"
SUBSYSTEM=="net", ACTION=="add", ATTR{addr_assign_type}=="0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="glean@$name.service"