Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-agent
Commits
f5b7eb5d
Commit
f5b7eb5d
authored
4 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
map-agent: use ioctl to bring wds iface up
parent
fa789102
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/brcm_nl.c
+39
-2
39 additions, 2 deletions
src/utils/brcm_nl.c
with
39 additions
and
2 deletions
src/utils/brcm_nl.c
+
39
−
2
View file @
f5b7eb5d
...
...
@@ -29,6 +29,42 @@
#define UCI_WIRELESS "wireless"
#define UCI_WLAN_IFACE "wifi-iface"
int
if_updown
(
const
char
*
ifname
,
bool
up
)
{
int
fd
;
struct
ifreq
ifr
;
short
flags
;
if
((
fd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
<
0
)
{
return
-
1
;
}
memset
(
&
ifr
,
0
,
sizeof
(
ifr
));
strncpy
(
ifr
.
ifr_name
,
ifname
,
IFNAMSIZ
);
if
(
ioctl
(
fd
,
SIOCGIFFLAGS
,
&
ifr
)
!=
0
)
{
close
(
fd
);
return
-
1
;
}
flags
=
ifr
.
ifr_flags
;
if
(
up
&&
!
(
flags
&
IFF_UP
))
ifr
.
ifr_flags
|=
IFF_UP
;
if
(
!
up
&&
(
flags
&
IFF_UP
))
ifr
.
ifr_flags
&=
~
IFF_UP
;
if
((
flags
!=
ifr
.
ifr_flags
)
&&
(
0
!=
ioctl
(
fd
,
SIOCSIFFLAGS
,
&
ifr
)))
{
close
(
fd
);
return
-
1
;
}
close
(
fd
);
return
0
;
}
static
bool
get_bridge
(
char
*
ifname
,
char
*
bridge
)
{
strncpy
(
bridge
,
"br-lan"
,
15
);
...
...
@@ -73,9 +109,10 @@ static int func(struct nl_msg *msg, void *arg)
"bridge %s
\n
"
,
ifname
,
bridge
);
/* bring up wds interface */
ret
=
if_setflags
(
ifname
,
IFF_UP
);
//ret = if_setflags(ifname, IFF_UP);
ret
=
if_updown
(
ifname
,
true
);
if
(
!
ret
)
printf
(
"Successfully brought up interface %s"
,
printf
(
"Successfully brought up interface %s
\n
"
,
ifname
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment