Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
95ea3d1f
Unverified
Commit
95ea3d1f
authored
Feb 05, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: remove stack allocations
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
244f7f87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
network.c
src/lxc/network.c
+3
-2
No files found.
src/lxc/network.c
View file @
95ea3d1f
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
#include "file_utils.h"
#include "file_utils.h"
#include "log.h"
#include "log.h"
#include "macro.h"
#include "macro.h"
#include "memory_utils.h"
#include "network.h"
#include "network.h"
#include "nl.h"
#include "nl.h"
#include "raw_syscalls.h"
#include "raw_syscalls.h"
...
@@ -549,15 +550,15 @@ out:
...
@@ -549,15 +550,15 @@ out:
#define PHYSNAME "/sys/class/net/%s/phy80211/name"
#define PHYSNAME "/sys/class/net/%s/phy80211/name"
static
char
*
is_wlan
(
const
char
*
ifname
)
static
char
*
is_wlan
(
const
char
*
ifname
)
{
{
__do_free
char
*
path
;
int
i
,
ret
;
int
i
,
ret
;
long
physlen
;
long
physlen
;
size_t
len
;
size_t
len
;
char
*
path
;
FILE
*
f
;
FILE
*
f
;
char
*
physname
=
NULL
;
char
*
physname
=
NULL
;
len
=
strlen
(
ifname
)
+
strlen
(
PHYSNAME
)
-
1
;
len
=
strlen
(
ifname
)
+
strlen
(
PHYSNAME
)
-
1
;
path
=
alloca
(
len
+
1
);
path
=
must_realloc
(
NULL
,
len
+
1
);
ret
=
snprintf
(
path
,
len
,
PHYSNAME
,
ifname
);
ret
=
snprintf
(
path
,
len
,
PHYSNAME
,
ifname
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
len
)
if
(
ret
<
0
||
(
size_t
)
ret
>=
len
)
goto
bad
;
goto
bad
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment