networkd: link - intialize mac address

Otherwise .netwrok matching on MAC address will not work.

Based on patch by Dave Reisner, and bug originally reported by Max Pray.
This commit is contained in:
Tom Gundersen 2014-06-04 21:29:08 +02:00
parent f598ac3e28
commit 512922f8b4
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ static int link_new(Manager *manager, sd_rtnl_message *message, Link **ret) {
if (!link->ifname)
return -ENOMEM;
r = sd_rtnl_message_read_ether_addr(message, IFLA_ADDRESS, &link->mac);
if (r < 0)
return r;
r = asprintf(&link->state_file, "/run/systemd/netif/links/%"PRIu64,
link->ifindex);
if (r < 0)