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
ed14a30f
Commit
ed14a30f
authored
Sep 06, 2017
by
Wolfgang Bumiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove unnecessary zeroing
The entire netdev is zeroed via memset() already. Unions and all. Signed-off-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
parent
b737ac4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
19 deletions
+0
-19
confile_legacy.c
src/lxc/confile_legacy.c
+0
-10
confile_utils.c
src/lxc/confile_utils.c
+0
-9
No files found.
src/lxc/confile_legacy.c
View file @
ed14a30f
...
@@ -170,16 +170,6 @@ int set_config_network_legacy_type(const char *key, const char *value,
...
@@ -170,16 +170,6 @@ int set_config_network_legacy_type(const char *key, const char *value,
lxc_list_init
(
&
netdev
->
ipv4
);
lxc_list_init
(
&
netdev
->
ipv4
);
lxc_list_init
(
&
netdev
->
ipv6
);
lxc_list_init
(
&
netdev
->
ipv6
);
netdev
->
name
[
0
]
=
'\0'
;
netdev
->
link
[
0
]
=
'\0'
;
memset
(
&
netdev
->
priv
,
0
,
sizeof
(
netdev
->
priv
));
/* I'm not completely sure if the memset takes care to zero the arrays
* in the union as well. So let's make extra sure and set the first byte
* to zero so that we don't have any surprises.
*/
netdev
->
priv
.
veth_attr
.
pair
[
0
]
=
'\0'
;
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
=
'\0'
;
list
=
malloc
(
sizeof
(
*
list
));
list
=
malloc
(
sizeof
(
*
list
));
if
(
!
list
)
{
if
(
!
list
)
{
SYSERROR
(
"failed to allocate memory"
);
SYSERROR
(
"failed to allocate memory"
);
...
...
src/lxc/confile_utils.c
View file @
ed14a30f
...
@@ -183,15 +183,6 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail
...
@@ -183,15 +183,6 @@ struct lxc_netdev *lxc_network_add(struct lxc_list *networks, int idx, bool tail
memset
(
netdev
,
0
,
sizeof
(
*
netdev
));
memset
(
netdev
,
0
,
sizeof
(
*
netdev
));
lxc_list_init
(
&
netdev
->
ipv4
);
lxc_list_init
(
&
netdev
->
ipv4
);
lxc_list_init
(
&
netdev
->
ipv6
);
lxc_list_init
(
&
netdev
->
ipv6
);
netdev
->
name
[
0
]
=
'\0'
;
netdev
->
link
[
0
]
=
'\0'
;
memset
(
&
netdev
->
priv
,
0
,
sizeof
(
netdev
->
priv
));
/* I'm not completely sure if the memset takes care to zero the arrays
* in the union as well. So let's make extra sure and set the first byte
* to zero so that we don't have any surprises.
*/
netdev
->
priv
.
veth_attr
.
pair
[
0
]
=
'\0'
;
netdev
->
priv
.
veth_attr
.
veth1
[
0
]
=
'\0'
;
/* give network a unique index */
/* give network a unique index */
netdev
->
idx
=
idx
;
netdev
->
idx
=
idx
;
...
...
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