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
5648fc19
Unverified
Commit
5648fc19
authored
Mar 04, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile_utils: make update_hwaddr() static
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3db41a6c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
36 deletions
+34
-36
confile.c
src/lxc/confile.c
+34
-0
confile_utils.c
src/lxc/confile_utils.c
+0
-35
confile_utils.h
src/lxc/confile_utils.h
+0
-1
No files found.
src/lxc/confile.c
View file @
5648fc19
...
@@ -2081,6 +2081,40 @@ static int set_config_console_size(const char *key, const char *value,
...
@@ -2081,6 +2081,40 @@ static int set_config_console_size(const char *key, const char *value,
return
0
;
return
0
;
}
}
/*
* If we find a lxc.net.[i].hwaddr or lxc.network.hwaddr in the original config
* file, we expand it in the unexpanded_config, so that after a save_config we
* store the hwaddr for re-use.
* This is only called when reading the config file, not when executing a
* lxc.include.
* 'x' and 'X' are substituted in-place.
*/
static
void
update_hwaddr
(
const
char
*
line
)
{
char
*
p
;
line
+=
lxc_char_left_gc
(
line
,
strlen
(
line
));
if
(
line
[
0
]
==
'#'
)
return
;
if
(
!
lxc_config_net_is_hwaddr
(
line
))
return
;
/* Let config_net_hwaddr raise the error. */
p
=
strchr
(
line
,
'='
);
if
(
!
p
)
return
;
p
++
;
while
(
isblank
(
*
p
))
p
++
;
if
(
!*
p
)
return
;
rand_complete_hwaddr
(
p
);
}
int
append_unexp_config_line
(
const
char
*
line
,
struct
lxc_conf
*
conf
)
int
append_unexp_config_line
(
const
char
*
line
,
struct
lxc_conf
*
conf
)
{
{
size_t
linelen
;
size_t
linelen
;
...
...
src/lxc/confile_utils.c
View file @
5648fc19
...
@@ -601,40 +601,6 @@ void rand_complete_hwaddr(char *hwaddr)
...
@@ -601,40 +601,6 @@ void rand_complete_hwaddr(char *hwaddr)
}
}
}
}
/*
* If we find a lxc.net.[i].hwaddr or lxc.network.hwaddr in the original config
* file, we expand it in the unexpanded_config, so that after a save_config we
* store the hwaddr for re-use.
* This is only called when reading the config file, not when executing a
* lxc.include.
* 'x' and 'X' are substituted in-place.
*/
void
update_hwaddr
(
const
char
*
line
)
{
char
*
p
;
line
+=
lxc_char_left_gc
(
line
,
strlen
(
line
));
if
(
line
[
0
]
==
'#'
)
return
;
if
(
!
lxc_config_net_is_hwaddr
(
line
))
return
;
/* Let config_net_hwaddr raise the error. */
p
=
strchr
(
line
,
'='
);
if
(
!
p
)
return
;
p
++
;
while
(
isblank
(
*
p
))
p
++
;
if
(
!*
p
)
return
;
rand_complete_hwaddr
(
p
);
}
bool
new_hwaddr
(
char
*
hwaddr
)
bool
new_hwaddr
(
char
*
hwaddr
)
{
{
int
ret
;
int
ret
;
...
@@ -703,7 +669,6 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
...
@@ -703,7 +669,6 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
return
fulllen
;
return
fulllen
;
}
}
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
)
int
lxc_get_conf_size_t
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
size_t
v
)
{
{
int
len
;
int
len
;
...
...
src/lxc/confile_utils.h
View file @
5648fc19
...
@@ -67,7 +67,6 @@ extern int config_ip_prefix(struct in_addr *addr);
...
@@ -67,7 +67,6 @@ extern int config_ip_prefix(struct in_addr *addr);
extern
int
network_ifname
(
char
*
valuep
,
const
char
*
value
,
size_t
size
);
extern
int
network_ifname
(
char
*
valuep
,
const
char
*
value
,
size_t
size
);
extern
void
rand_complete_hwaddr
(
char
*
hwaddr
);
extern
void
rand_complete_hwaddr
(
char
*
hwaddr
);
extern
bool
lxc_config_net_is_hwaddr
(
const
char
*
line
);
extern
bool
lxc_config_net_is_hwaddr
(
const
char
*
line
);
extern
void
update_hwaddr
(
const
char
*
line
);
extern
bool
new_hwaddr
(
char
*
hwaddr
);
extern
bool
new_hwaddr
(
char
*
hwaddr
);
extern
int
lxc_get_conf_str
(
char
*
retv
,
int
inlen
,
const
char
*
value
);
extern
int
lxc_get_conf_str
(
char
*
retv
,
int
inlen
,
const
char
*
value
);
extern
int
lxc_get_conf_bool
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
bool
v
);
extern
int
lxc_get_conf_bool
(
struct
lxc_conf
*
c
,
char
*
retv
,
int
inlen
,
bool
v
);
...
...
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