[systemd-devel] [PATCH] Kernel mac address assignment to VLAN NETDEV
O Neill, David M
david.m.oneill at intel.com
Thu Oct 8 02:15:07 PDT 2015
The creation of a VLAN netdev device, as seen in the 'ip link' command, is
done without specifying a mac address.
The kernel determines the mac address for the VLAN NETDEV, which should be
the parent mac address.
This patch fixes this behavior and the resulting delivery of DHCP Offers to
the VLAN NETDEV.
Technical Contributors
Rami Rosen <rami.rosen at intel.com>
Szczerbik, PrzemyslawX <przemyslawx.szczerbik at intel.com>
Signed-off-by: David O Neill <david.m.oneill at intel.com>
---
src/network/networkd-netdev.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 6949b40..2c1dd9e 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -647,9 +647,14 @@ static int netdev_load_one(Manager *manager, const char
*filename) {
return log_oom();
if (!netdev->mac) {
- r = netdev_get_mac(netdev->ifname, &netdev->mac);
- if (r < 0)
- return log_error_errno(r, "Failed to generate
predictable MAC address for %s: %m", netdev->ifname);
+ /* do not generate mac for VLAN netdev, allow kernel to
assign mac (parent mac) */
+ if(netdev->kind != NETDEV_KIND_VLAN) {
+ r = netdev_get_mac(netdev->ifname, &netdev->mac);
+ if (r < 0)
+ return log_error_errno(r, "Failed to
generate predictable MAC address for %s: %m", netdev->ifname);
+ } else {
+ log_debug_netdev(netdev, "Skipping generating MAC
address for vlan netdev");
+ }
}
r = hashmap_put(netdev->manager->netdevs, netdev->ifname, netdev);
--
1.8.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7580 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151008/8bf2f637/attachment.bin>
-------------- next part --------------
--------------------------------------------------------------
Intel Shannon Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
Business address: Dromore House, East Park, Shannon, Co. Clare
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
More information about the systemd-devel
mailing list