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
9f423d09
Unverified
Commit
9f423d09
authored
Oct 07, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: s/MAXPATHLEN/PATH_MAX/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
bb2249df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
network.c
src/lxc/network.c
+9
-9
No files found.
src/lxc/network.c
View file @
9f423d09
...
@@ -1358,15 +1358,15 @@ static int proc_sys_net_write(const char *path, const char *value)
...
@@ -1358,15 +1358,15 @@ static int proc_sys_net_write(const char *path, const char *value)
static
int
neigh_proxy_set
(
const
char
*
ifname
,
int
family
,
int
flag
)
static
int
neigh_proxy_set
(
const
char
*
ifname
,
int
family
,
int
flag
)
{
{
int
ret
;
int
ret
;
char
path
[
MAXPATHLEN
];
char
path
[
PATH_MAX
];
if
(
family
!=
AF_INET
&&
family
!=
AF_INET6
)
if
(
family
!=
AF_INET
&&
family
!=
AF_INET6
)
return
-
EINVAL
;
return
-
EINVAL
;
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"/proc/sys/net/%s/conf/%s/%s"
,
ret
=
snprintf
(
path
,
PATH_MAX
,
"/proc/sys/net/%s/conf/%s/%s"
,
family
==
AF_INET
?
"ipv4"
:
"ipv6"
,
ifname
,
family
==
AF_INET
?
"ipv4"
:
"ipv6"
,
ifname
,
family
==
AF_INET
?
"proxy_arp"
:
"proxy_ndp"
);
family
==
AF_INET
?
"proxy_arp"
:
"proxy_ndp"
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
MAXPATHLEN
)
if
(
ret
<
0
||
(
size_t
)
ret
>=
PATH_MAX
)
return
-
E2BIG
;
return
-
E2BIG
;
return
proc_sys_net_write
(
path
,
flag
?
"1"
:
"0"
);
return
proc_sys_net_write
(
path
,
flag
?
"1"
:
"0"
);
...
@@ -1847,7 +1847,7 @@ static int lxc_ovs_delete_port_exec(void *data)
...
@@ -1847,7 +1847,7 @@ static int lxc_ovs_delete_port_exec(void *data)
int
lxc_ovs_delete_port
(
const
char
*
bridge
,
const
char
*
nic
)
int
lxc_ovs_delete_port
(
const
char
*
bridge
,
const
char
*
nic
)
{
{
int
ret
;
int
ret
;
char
cmd_output
[
MAXPATHLEN
];
char
cmd_output
[
PATH_MAX
];
struct
ovs_veth_args
args
;
struct
ovs_veth_args
args
;
args
.
bridge
=
bridge
;
args
.
bridge
=
bridge
;
...
@@ -1875,7 +1875,7 @@ static int lxc_ovs_attach_bridge_exec(void *data)
...
@@ -1875,7 +1875,7 @@ static int lxc_ovs_attach_bridge_exec(void *data)
static
int
lxc_ovs_attach_bridge
(
const
char
*
bridge
,
const
char
*
nic
)
static
int
lxc_ovs_attach_bridge
(
const
char
*
bridge
,
const
char
*
nic
)
{
{
int
ret
;
int
ret
;
char
cmd_output
[
MAXPATHLEN
];
char
cmd_output
[
PATH_MAX
];
struct
ovs_veth_args
args
;
struct
ovs_veth_args
args
;
args
.
bridge
=
bridge
;
args
.
bridge
=
bridge
;
...
@@ -2093,7 +2093,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna
...
@@ -2093,7 +2093,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna
int
bytes
,
pipefd
[
2
];
int
bytes
,
pipefd
[
2
];
char
*
token
,
*
saveptr
=
NULL
;
char
*
token
,
*
saveptr
=
NULL
;
char
netdev_link
[
IFNAMSIZ
];
char
netdev_link
[
IFNAMSIZ
];
char
buffer
[
MAXPATHLEN
]
=
{
0
};
char
buffer
[
PATH_MAX
]
=
{
0
};
size_t
retlen
;
size_t
retlen
;
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
...
@@ -2163,7 +2163,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna
...
@@ -2163,7 +2163,7 @@ static int lxc_create_network_unpriv_exec(const char *lxcpath, const char *lxcna
/* close the write-end of the pipe */
/* close the write-end of the pipe */
close
(
pipefd
[
1
]);
close
(
pipefd
[
1
]);
bytes
=
lxc_read_nointr
(
pipefd
[
0
],
&
buffer
,
MAXPATHLEN
);
bytes
=
lxc_read_nointr
(
pipefd
[
0
],
&
buffer
,
PATH_MAX
);
if
(
bytes
<
0
)
{
if
(
bytes
<
0
)
{
SYSERROR
(
"Failed to read from pipe file descriptor"
);
SYSERROR
(
"Failed to read from pipe file descriptor"
);
close
(
pipefd
[
0
]);
close
(
pipefd
[
0
]);
...
@@ -2257,7 +2257,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, const char *lxcna
...
@@ -2257,7 +2257,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, const char *lxcna
int
bytes
,
ret
;
int
bytes
,
ret
;
pid_t
child
;
pid_t
child
;
int
pipefd
[
2
];
int
pipefd
[
2
];
char
buffer
[
MAXPATHLEN
]
=
{
0
};
char
buffer
[
PATH_MAX
]
=
{
0
};
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
if
(
netdev
->
type
!=
LXC_NET_VETH
)
{
ERROR
(
"Network type %d not support for unprivileged use"
,
netdev
->
type
);
ERROR
(
"Network type %d not support for unprivileged use"
,
netdev
->
type
);
...
@@ -2319,7 +2319,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, const char *lxcna
...
@@ -2319,7 +2319,7 @@ static int lxc_delete_network_unpriv_exec(const char *lxcpath, const char *lxcna
close
(
pipefd
[
1
]);
close
(
pipefd
[
1
]);
bytes
=
lxc_read_nointr
(
pipefd
[
0
],
&
buffer
,
MAXPATHLEN
);
bytes
=
lxc_read_nointr
(
pipefd
[
0
],
&
buffer
,
PATH_MAX
);
if
(
bytes
<
0
)
{
if
(
bytes
<
0
)
{
SYSERROR
(
"Failed to read from pipe file descriptor."
);
SYSERROR
(
"Failed to read from pipe file descriptor."
);
close
(
pipefd
[
0
]);
close
(
pipefd
[
0
]);
...
...
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