diff options
author | Tom Gundersen <teg@jklm.no> | 2013-11-17 21:01:20 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-11-17 23:11:11 +0100 |
commit | 8cd11a0f0f4ca05199e1166f6a07472b296f7455 (patch) | |
tree | d9971380a1327d4bb7f392bb67d7c2c5d75f3184 /src/network/networkd-link.c | |
parent | 16be43684f6d9bbd494b157682f5473460fbf98a (diff) |
networkd: store netmask and mac address explicitly
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 085b8db2f8..d0a3dccd9b 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -29,6 +29,7 @@ int link_new(Manager *manager, struct udev_device *device, Link **ret) { _cleanup_link_free_ Link *link = NULL; uint64_t ifindex; + const char *mac; int r; assert(device); @@ -42,6 +43,11 @@ int link_new(Manager *manager, struct udev_device *device, Link **ret) { if (ifindex <= 0) return -EINVAL; + mac = udev_device_get_sysattr_value(device, "address"); + if (!mac) + return -EINVAL; + + memcpy(&link->mac.ether_addr_octet[0], ether_aton(mac), ETH_ALEN); link->ifindex = ifindex; link->manager = manager; |