summaryrefslogtreecommitdiff
path: root/system-dummy.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-11-30 12:34:13 +0100
committerFelix Fietkau <nbd@nbd.name>2020-11-30 12:39:25 +0100
commit42c48866f1c1fce068f41536baa8dd2e80fc08d7 (patch)
tree439389ff79d44a5eb48c3fd5d3c60c0a5f36f024 /system-dummy.c
parent524310276f2084d419cb0f2de58b0f42641d987f (diff)
downloadnetifd-42c48866f1c1fce068f41536baa8dd2e80fc08d7.tar.gz
config: parse default mac address from board.json
Example: { "network-device": { "eth0": { "macaddr": "bc:a5:11:16:76:d7" } } } Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'system-dummy.c')
-rw-r--r--system-dummy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/system-dummy.c b/system-dummy.c
index 4ad9db5..6bf0f8b 100644
--- a/system-dummy.c
+++ b/system-dummy.c
@@ -159,7 +159,9 @@ system_if_dump_stats(struct device *dev, struct blob_buf *b)
void
system_if_apply_settings(struct device *dev, struct device_settings *s, unsigned int apply_mask)
{
- if ((s->flags & DEV_OPT_MACADDR & apply_mask) && !dev->external) {
+ apply_mask &= s->flags;
+
+ if ((apply_mask & (DEV_OPT_MACADDR | DEV_OPT_DEFAULT_MACADDR)) && !dev->external) {
D(SYSTEM, "ifconfig %s hw ether %s\n",
dev->ifname, format_macaddr(s->macaddr));
}