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
6af0bd7b
Unverified
Commit
6af0bd7b
authored
Apr 26, 2019
by
Stéphane Graber
Committed by
GitHub
Apr 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2952 from tomponline/tp-vlan-upscript
network: Adds hook handling for vlan network type
parents
a82463a0
3a73d9f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
network.c
src/lxc/network.c
+30
-0
No files found.
src/lxc/network.c
View file @
6af0bd7b
...
@@ -297,6 +297,21 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
...
@@ -297,6 +297,21 @@ static int instantiate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
return
-
1
;
return
-
1
;
}
}
if
(
netdev
->
upscript
)
{
char
*
argv
[]
=
{
"vlan"
,
netdev
->
link
,
NULL
,
};
err
=
run_script_argv
(
handler
->
name
,
handler
->
conf
->
hooks_version
,
"net"
,
netdev
->
upscript
,
"up"
,
argv
);
if
(
err
<
0
)
lxc_netdev_delete_by_name
(
peer
);
return
-
1
;
}
DEBUG
(
"Instantiated vlan
\"
%s
\"
with ifindex is
\"
%d
\"
(vlan1000)"
,
DEBUG
(
"Instantiated vlan
\"
%s
\"
with ifindex is
\"
%d
\"
(vlan1000)"
,
peer
,
netdev
->
ifindex
);
peer
,
netdev
->
ifindex
);
if
(
netdev
->
mtu
)
{
if
(
netdev
->
mtu
)
{
...
@@ -447,6 +462,21 @@ static int shutdown_macvlan(struct lxc_handler *handler, struct lxc_netdev *netd
...
@@ -447,6 +462,21 @@ static int shutdown_macvlan(struct lxc_handler *handler, struct lxc_netdev *netd
static
int
shutdown_vlan
(
struct
lxc_handler
*
handler
,
struct
lxc_netdev
*
netdev
)
static
int
shutdown_vlan
(
struct
lxc_handler
*
handler
,
struct
lxc_netdev
*
netdev
)
{
{
int
ret
;
char
*
argv
[]
=
{
"vlan"
,
netdev
->
link
,
NULL
,
};
if
(
!
netdev
->
downscript
)
return
0
;
ret
=
run_script_argv
(
handler
->
name
,
handler
->
conf
->
hooks_version
,
"net"
,
netdev
->
downscript
,
"down"
,
argv
);
if
(
ret
<
0
)
return
-
1
;
return
0
;
return
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