summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorTobias Jungel <tobias.jungel@bisdn.de>2016-06-01 15:18:21 +0200
committerTobias Jungel <tobias.jungel@bisdn.de>2016-06-10 09:10:41 +0200
commit13b498f967c5117a88d72304bed1f8c0b9c1bb87 (patch)
treed2a48a8958bb4ca2fff71a9a50c29eb620f00f05 /src/network/networkd-link.c
parent6cad256dbe6343de4329934ea7c08707a365d340 (diff)
networkd: add support to configure VLAN on bridge ports
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5f25873b46..dce5c2be6e 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1114,6 +1114,16 @@ int link_address_remove_handler(sd_netlink *rtnl, sd_netlink_message *m, void *u
return 1;
}
+static int link_set_bridge_vlan(Link *link) {
+ int r = 0;
+
+ r = br_vlan_configure(link, link->network->pvid, link->network->br_vid_bitmap, link->network->br_untagged_bitmap);
+ if (r < 0)
+ log_link_error_errno(link, r, "Failed to assign VLANs to bridge port: %m");
+
+ return r;
+}
+
static int link_set_bridge_fdb(Link *link) {
FdbEntry *fdb_entry;
int r = 0;
@@ -1996,6 +2006,12 @@ static int link_joined(Link *link) {
log_link_error_errno(link, r, "Could not set bridge message: %m");
}
+ if (link->network->bridge || NETDEV_KIND_BRIDGE == netdev_kind_from_string(link->kind)) {
+ r = link_set_bridge_vlan(link);
+ if (r < 0)
+ log_link_error_errno(link, r, "Could not set bridge vlan: %m");
+ }
+
return link_enter_set_addresses(link);
}