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
2a25eb27
Unverified
Commit
2a25eb27
authored
Feb 26, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: carry some structs to ease backports
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
609c5019
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
0 deletions
+46
-0
confile_utils.c
src/lxc/confile_utils.c
+15
-0
macro.h
src/lxc/macro.h
+28
-0
network.c
src/lxc/network.c
+0
-0
network.h
src/lxc/network.h
+3
-0
No files found.
src/lxc/confile_utils.c
View file @
2a25eb27
...
...
@@ -247,6 +247,7 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
switch
(
netdev
->
type
)
{
case
LXC_NET_VETH
:
TRACE
(
"type: veth"
);
TRACE
(
"veth mode: %d"
,
netdev
->
priv
.
veth_attr
.
mode
);
if
(
netdev
->
priv
.
veth_attr
.
pair
[
0
]
!=
'\0'
)
TRACE
(
"veth pair: %s"
,
...
...
@@ -259,6 +260,15 @@ void lxc_log_configured_netdevs(const struct lxc_conf *conf)
if
(
netdev
->
priv
.
veth_attr
.
ifindex
>
0
)
TRACE
(
"host side ifindex for veth device: %d"
,
netdev
->
priv
.
veth_attr
.
ifindex
);
if
(
netdev
->
priv
.
veth_attr
.
vlan_id_set
)
TRACE
(
"veth vlan id: %d"
,
netdev
->
priv
.
veth_attr
.
vlan_id
);
lxc_list_for_each_safe
(
cur
,
&
netdev
->
priv
.
veth_attr
.
vlan_tagged_ids
,
next
)
{
unsigned
short
vlan_tagged_id
=
PTR_TO_USHORT
(
cur
->
elem
);
TRACE
(
"veth vlan tagged id: %u"
,
vlan_tagged_id
);
}
break
;
case
LXC_NET_MACVLAN
:
TRACE
(
"type: macvlan"
);
...
...
@@ -432,6 +442,11 @@ static void lxc_free_netdev(struct lxc_netdev *netdev)
free
(
cur
->
elem
);
free
(
cur
);
}
lxc_list_for_each_safe
(
cur
,
&
netdev
->
priv
.
veth_attr
.
vlan_tagged_ids
,
next
)
{
lxc_list_del
(
cur
);
free
(
cur
);
}
}
free
(
netdev
);
...
...
src/lxc/macro.h
View file @
2a25eb27
...
...
@@ -548,6 +548,34 @@ extern int __build_bug_on_failed;
#define IPVLAN_ISOLATION_VEPA 2
#endif
#ifndef BRIDGE_VLAN_NONE
#define BRIDGE_VLAN_NONE -1
/* Bridge VLAN option set to "none". */
#endif
#ifndef BRIDGE_VLAN_ID_MAX
#define BRIDGE_VLAN_ID_MAX 4094
/* Bridge VLAN MAX VLAN ID. */
#endif
#ifndef BRIDGE_FLAGS_MASTER
#define BRIDGE_FLAGS_MASTER 1
/* Bridge command to/from parent */
#endif
#ifndef BRIDGE_VLAN_INFO_PVID
#define BRIDGE_VLAN_INFO_PVID (1<<1)
/* VLAN is PVID, ingress untagged */
#endif
#ifndef BRIDGE_VLAN_INFO_UNTAGGED
#define BRIDGE_VLAN_INFO_UNTAGGED (1<<2)
/* VLAN egresses untagged */
#endif
#ifndef IFLA_BRIDGE_FLAGS
#define IFLA_BRIDGE_FLAGS 0
#endif
#ifndef IFLA_BRIDGE_VLAN_INFO
#define IFLA_BRIDGE_VLAN_INFO 2
#endif
/* Attributes of RTM_NEWNSID/RTM_GETNSID messages */
enum
{
__LXC_NETNSA_NONE
,
...
...
src/lxc/network.c
View file @
2a25eb27
This diff is collapsed.
Click to expand it.
src/lxc/network.h
View file @
2a25eb27
...
...
@@ -80,6 +80,9 @@ struct ifla_veth {
struct
lxc_list
ipv4_routes
;
struct
lxc_list
ipv6_routes
;
int
mode
;
/* bridge, router */
short
vlan_id
;
bool
vlan_id_set
;
struct
lxc_list
vlan_tagged_ids
;
};
struct
ifla_vlan
{
...
...
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