Skip to content
Snippets Groups Projects
Commit 4ce627dc authored by Jakob Olsson's avatar Jakob Olsson
Browse files

brcm_nl: probe for existing wds interface at boot

parent a669b008
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,7 @@ static int func(struct nl_msg *msg, void *arg) ...@@ -70,6 +70,7 @@ static int func(struct nl_msg *msg, void *arg)
struct nlmsghdr *nlh = nlmsg_hdr(msg); struct nlmsghdr *nlh = nlmsg_hdr(msg);
switch (nlh->nlmsg_type) { switch (nlh->nlmsg_type) {
case RTM_GETLINK:
case RTM_NEWLINK: case RTM_NEWLINK:
case RTM_DELLINK: case RTM_DELLINK:
{ {
...@@ -93,6 +94,10 @@ static int func(struct nl_msg *msg, void *arg) ...@@ -93,6 +94,10 @@ static int func(struct nl_msg *msg, void *arg)
if (!strstr(ifname, "wds")) if (!strstr(ifname, "wds"))
break; 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); printf("Adding interface %s to bridge %s!\n", ifname, bridge);
...@@ -132,6 +137,7 @@ int brcm_nl_loop(void *arg) ...@@ -132,6 +137,7 @@ int brcm_nl_loop(void *arg)
nl_connect(sk, NETLINK_ROUTE); nl_connect(sk, NETLINK_ROUTE);
nl_socket_add_memberships(sk, RTNLGRP_LINK, 0); nl_socket_add_memberships(sk, RTNLGRP_LINK, 0);
nl_rtgen_request(sk, RTM_GETLINK, AF_UNSPEC, NLM_F_DUMP);
for (;;) for (;;)
nl_recvmsgs_default(sk); nl_recvmsgs_default(sk);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment