From 4ce627dc8db31d20317c51538c9f5a1ed25ab308 Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakob.olsson@iopsys.eu> Date: Thu, 25 Feb 2021 16:32:32 +0100 Subject: [PATCH] brcm_nl: probe for existing wds interface at boot --- src/utils/brcm_nl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/brcm_nl.c b/src/utils/brcm_nl.c index 1fc46cb3a..90e89b239 100644 --- a/src/utils/brcm_nl.c +++ b/src/utils/brcm_nl.c @@ -70,6 +70,7 @@ static int func(struct nl_msg *msg, void *arg) struct nlmsghdr *nlh = nlmsg_hdr(msg); switch (nlh->nlmsg_type) { + case RTM_GETLINK: case RTM_NEWLINK: case RTM_DELLINK: { @@ -93,6 +94,10 @@ static int func(struct nl_msg *msg, void *arg) if (!strstr(ifname, "wds")) break; + if (if_isbridge_interface(ifname)) { + printf("Interface %s is already a part of a bridge\n", ifname); + break; + } printf("Adding interface %s to bridge %s!\n", ifname, bridge); @@ -132,6 +137,7 @@ int brcm_nl_loop(void *arg) nl_connect(sk, NETLINK_ROUTE); nl_socket_add_memberships(sk, RTNLGRP_LINK, 0); + nl_rtgen_request(sk, RTM_GETLINK, AF_UNSPEC, NLM_F_DUMP); for (;;) nl_recvmsgs_default(sk); -- GitLab