network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address

This is mostly equivalent to .link file's MACAddressPolicy=none.
This commit is contained in:
Yu Watanabe
2021-11-28 12:04:55 +09:00
parent 5dcc5b1a11
commit aaa5ca57ae
5 changed files with 46 additions and 7 deletions
+4
View File
@@ -10,6 +10,9 @@
#include "networkd-link.h"
#include "time-util.h"
/* Special hardware address value to suppress generating persistent hardware address for the netdev. */
#define HW_ADDR_NONE ((struct hw_addr_data) { .length = 1, })
#define NETDEV_COMMON_SECTIONS "Match\0NetDev\0"
/* This is the list of known sections. We need to ignore them in the initial parsing phase. */
#define NETDEV_OTHER_SECTIONS \
@@ -215,6 +218,7 @@ static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) {
}
CONFIG_PARSER_PROTOTYPE(config_parse_netdev_kind);
CONFIG_PARSER_PROTOTYPE(config_parse_netdev_hw_addr);
/* gperf */
const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, GPERF_LEN_TYPE length);