Re: [systemd-devel] [PATCH] Kernel mac address assignment to VLAN NETDEV

2015-10-12 Thread Lennart Poettering
On Thu, 08.10.15 09:15, O Neill, David M (david.m.one...@intel.com) wrote:

> 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.

Hmm, so the patch is line broken, which makes it hard to apply it.

Also, we prefer patch submissions via github these days. Any chance
you could resubmit this as github PR?

https://github.com/systemd/systemd

> Technical Contributors
> Rami Rosen 
> Szczerbik, PrzemyslawX 
> 
> Signed-off-by: David O Neill 

We don't use "Signed-off-by" in the systemd project. That's a kernel
thing.

> 
> ---
>  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");
> +}

No {} round single-line if blocks please, see CODING_STYLE on this.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Kernel mac address assignment to VLAN NETDEV

2015-10-08 Thread O Neill, David M
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 
Szczerbik, 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