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
b2722ecb
Unverified
Commit
b2722ecb
authored
Apr 09, 2020
by
KUWAZAWA Takuya
Committed by
Stéphane Graber
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: Make it possible to set the mode of IPVLAN to L2
Signed-off-by:
KUWAZAWA Takuya
<
albatross0@gmail.com
>
parent
c2e3e9a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
network.c
src/lxc/network.c
+12
-15
No files found.
src/lxc/network.c
View file @
b2722ecb
...
@@ -582,24 +582,21 @@ static int lxc_ipvlan_create(const char *master, const char *name, int mode, int
...
@@ -582,24 +582,21 @@ static int lxc_ipvlan_create(const char *master, const char *name, int mode, int
if
(
nla_put_string
(
nlmsg
,
IFLA_INFO_KIND
,
"ipvlan"
))
if
(
nla_put_string
(
nlmsg
,
IFLA_INFO_KIND
,
"ipvlan"
))
return
ret_errno
(
EPROTO
);
return
ret_errno
(
EPROTO
);
if
(
mode
)
{
nest2
=
nla_begin_nested
(
nlmsg
,
IFLA_INFO_DATA
);
nest2
=
nla_begin_nested
(
nlmsg
,
IFLA_INFO_DATA
);
if
(
!
nest2
)
if
(
!
nest2
)
return
ret_errno
(
EPROTO
);
return
ret_errno
(
EPROTO
);
if
(
nla_put_u32
(
nlmsg
,
IFLA_IPVLAN_MODE
,
mode
))
return
ret_errno
(
EPROTO
);
/* if_link.h does not define the isolation flag value for bridge mode so we define it as 0
if
(
nla_put_u32
(
nlmsg
,
IFLA_IPVLAN_MODE
,
mode
))
* and only send mode if mode >0 as default mode is bridge anyway according to ipvlan docs.
return
ret_errno
(
EPROTO
);
*/
if
(
isolation
>
0
&&
nla_put_u16
(
nlmsg
,
IFLA_IPVLAN_ISOLATION
,
isolation
))
return
ret_errno
(
EPROTO
);
nla_end_nested
(
nlmsg
,
nest2
);
/* if_link.h does not define the isolation flag value for bridge mode so we define it as 0
}
* and only send mode if mode >0 as default mode is bridge anyway according to ipvlan docs.
*/
if
(
isolation
>
0
&&
nla_put_u16
(
nlmsg
,
IFLA_IPVLAN_ISOLATION
,
isolation
))
return
ret_errno
(
EPROTO
);
nla_end_nested
(
nlmsg
,
nest2
);
nla_end_nested
(
nlmsg
,
nest
);
nla_end_nested
(
nlmsg
,
nest
);
if
(
nla_put_u32
(
nlmsg
,
IFLA_LINK
,
index
))
if
(
nla_put_u32
(
nlmsg
,
IFLA_LINK
,
index
))
...
...
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