summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-04 21:29:08 +0200
committerTom Gundersen <teg@jklm.no>2014-06-04 21:29:25 +0200
commit512922f8b423eed093918f78461b7bf7c45592cb (patch)
tree8e4633bf62b6461f4f8c4e5149434094a0f6383d /src/network
parentf598ac3e28b729dd0b1d0a881df3e16465687a2b (diff)
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.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 6e6fb8393e..3653426891 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -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)