[systemd-devel] [PATCH] Kernel mac address assignment to VLAN NETDEV
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 RosenSzczerbik, PrzemyslawX Signed-off-by: David O Neill --- 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, >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, >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 smime.p7s Description: S/MIME cryptographic signature -- 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. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] NetDev Vlan device copy parent mac
Hi, I have a working patch to copy the mac address from parent link to the netdev vlan device. Currently today when using the IP command this is the behavior seen and for our projects it is the behavior we would like to see for systemd-networkd also. In the systemd-networkd solution a mac address is generated using netdev_get_mac. I have implemented a patch the mimic this behavior, but as far as the matching goes, which solution would be best accepted for the device comparison? By providing the below key options, users can opt for this functionality or not. A key in the below format? Is the CopyParentMac option superfluous? [NetDev] Name=enp0s20f0.4094 Kind=vlan CopyParentMac=True Parent=enp0s20f0 [VLAN] Id=4094 Thanks Dave. smime.p7s Description: S/MIME cryptographic signature -- 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. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] networkd link state
Folks, I would like to introduce a flag enable=Boolean in the networkd configuration files. I am introducing new features that can create a large amount of configuration. Deleting and restoring configuration can be quiet laborious Renaming the files to another extension is possibly another option This configuration will be under configuration management using tools such as chef/puppet/cfengine. Typically net-tools/networkmanager etc has such a flag and existing in the ifcfg onboot / enabled. Switch technology has the ability to turn on and off the port without deleting the configuration also. What do you think? Thanks -- 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. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] networkd link state
Thanks! -Original Message- From: systemd-devel [mailto:systemd-devel-boun...@lists.freedesktop.org] On Behalf Of Jóhann B. Guðmundsson Sent: Thursday, December 4, 2014 3:55 PM To: systemd-devel@lists.freedesktop.org Subject: Re: [systemd-devel] networkd link state On 12/04/2014 03:47 PM, O Neill, David M wrote: What do you think? I think this should be consisted with other unit enablement in systemd not handled by introducing a new enabled/disabled flag JBG ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- 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. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] networkd link state
Jóhann/All, If you could expand on how you solve the following: Systemd-networkd is a single process and it reads its configuration from /etc/systemd/network. How do unit files, solve a single process managing multiple netdevs? Taking a switch as a use case with 64 ports, a port could have quite a lot of configuration associated with it; in a file such as /etc/system/network/sw0p1.link (network/link). Are you suggesting we using symlinks like systemctl manages daemons on boot to solve the enable/disabled problem? Thanks Dave. -Original Message- From: O Neill, David M Sent: Thursday, December 4, 2014 4:06 PM To: 'Jóhann B. Guðmundsson'; systemd-devel@lists.freedesktop.org Subject: RE: [systemd-devel] networkd link state Thanks! -Original Message- From: systemd-devel [mailto:systemd-devel-boun...@lists.freedesktop.org] On Behalf Of Jóhann B. Guðmundsson Sent: Thursday, December 4, 2014 3:55 PM To: systemd-devel@lists.freedesktop.org Subject: Re: [systemd-devel] networkd link state On 12/04/2014 03:47 PM, O Neill, David M wrote: What do you think? I think this should be consisted with other unit enablement in systemd not handled by introducing a new enabled/disabled flag JBG ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- 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. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel