diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-21 22:08:04 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-04-21 22:12:53 +0200 |
commit | 7d95c772cba1836545459760273b13f2e01dd2a8 (patch) | |
tree | 73e2928745863bcf4d09cd485e75b3efd767610f | |
parent | efe6e7d33a9feb0b647c77862016284457895fa6 (diff) |
Revert "networkd: netdev - set predictable mac address when creating netdev"
This reverts commit cdc85c875b842b9309f72caefc51c262f521cf92.
There appears to be a kernel bug that (among other things) cause bridges
not to get a bridge id set when supplying IFLA_ADDRESS when creating the
netdev.
Simply revert the whole thing until we sort this out in the kernel.
See: http://www.spinics.net/lists/netdev/msg279807.html
Reported-by: C. R. Oldham <cr@saltstack.com>
-rw-r--r-- | src/network/networkd-netdev.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c index d503058e59..72c6c92468 100644 --- a/src/network/networkd-netdev.c +++ b/src/network/networkd-netdev.c @@ -25,7 +25,6 @@ #include "conf-files.h" #include "conf-parser.h" #include "list.h" -#include "siphash24.h" #define VLANID_MAX 4094 @@ -181,48 +180,8 @@ static int netdev_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda return 1; } -#define HASH_KEY SD_ID128_MAKE(52,e1,45,bd,00,6f,29,96,21,c6,30,6d,83,71,04,48) - -static int netdev_get_mac(NetDev *netdev, struct ether_addr *mac) { - uint8_t result[8]; - size_t l, sz; - uint8_t *v; - int r; - - assert(netdev); - assert(netdev->name); - assert(mac); - - l = strlen(netdev->name); - sz = sizeof(sd_id128_t) + l; - v = alloca(sz); - - /* fetch some persistent data unique to the machine */ - r = sd_id128_get_machine((sd_id128_t*) v); - if (r < 0) - return r; - - /* combine with some data unique (on this machine) to this - * netdev */ - memcpy(v + sizeof(sd_id128_t), netdev->name, l); - - /* Let's hash the host machine ID plus the container name. We - * use a fixed, but originally randomly created hash key here. */ - siphash24(result, v, sz, HASH_KEY.bytes); - - assert_cc(ETH_ALEN <= sizeof(result)); - memcpy(mac->ether_addr_octet, result, ETH_ALEN); - - /* see eth_random_addr in the kernel */ - mac->ether_addr_octet[0] &= 0xfe; /* clear multicast bit */ - mac->ether_addr_octet[0] |= 0x02; /* set local assignment bit (IEEE802) */ - - return 0; -} - static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callback) { _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL; - struct ether_addr mac; const char *kind; int r; @@ -233,12 +192,6 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c assert(netdev->manager); assert(netdev->manager->rtnl); - r = netdev_get_mac(netdev, &mac); - if (r < 0) { - log_error("Failed to generate predictable MAC address for %s", netdev->name); - return r; - } - r = sd_rtnl_message_new_link(netdev->manager->rtnl, &req, RTM_NEWLINK, 0); if (r < 0) { log_error_netdev(netdev, @@ -265,14 +218,6 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c return r; } - r = sd_rtnl_message_append_ether_addr(req, IFLA_ADDRESS, &mac); - if (r < 0) { - log_error_netdev(netdev, - "Colud not append IFLA_ADDRESS attribute: %s", - strerror(-r)); - return r; - } - r = sd_rtnl_message_open_container(req, IFLA_LINKINFO); if (r < 0) { log_error_netdev(netdev, |