summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.c
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-05-21 14:01:04 +0530
committerTom Gundersen <teg@jklm.no>2014-06-02 16:09:40 +0200
commit10142d75cce10a92889cc11b7b1af07fecc78c5d (patch)
tree45912e46dfcba7ad3aaa74508c5761bb43e64b43 /src/network/networkd-netdev.c
parentb686acb27ea4de042320fa196cfb14e08f30165b (diff)
networkd: introduce veth device support
This patch adds veth device support to networkd. Example conf: File: veth.netdev [NetDev] Name=veth-test Kind=veth [Peer] Name=veth-peer
Diffstat (limited to 'src/network/networkd-netdev.c')
-rw-r--r--src/network/networkd-netdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index c54b0c10f2..472028c447 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -38,6 +38,7 @@ static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = {
[NETDEV_KIND_IPIP] = "ipip",
[NETDEV_KIND_GRE] = "gre",
[NETDEV_KIND_SIT] = "sit",
+ [NETDEV_KIND_VETH] = "veth",
};
DEFINE_STRING_TABLE_LOOKUP(netdev_kind, NetDevKind);
@@ -546,7 +547,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
netdev->macvlan_mode = _NETDEV_MACVLAN_MODE_INVALID;
netdev->vlanid = VLANID_MAX + 1;
- r = config_parse(NULL, filename, file, "Match\0NetDev\0VLAN\0MACVLAN\0Tunnel\0",
+ r = config_parse(NULL, filename, file, "Match\0NetDev\0VLAN\0MACVLAN\0Tunnel\0Peer\0",
config_item_perf_lookup, (void*) network_netdev_gperf_lookup,
false, false, netdev);
if (r < 0) {
@@ -598,6 +599,9 @@ static int netdev_load_one(Manager *manager, const char *filename) {
LIST_HEAD_INIT(netdev->callbacks);
+ if(netdev->kind == NETDEV_KIND_VETH)
+ return netdev_create_veth(netdev, netdev_create_handler);
+
if (netdev->kind != NETDEV_KIND_VLAN &&
netdev->kind != NETDEV_KIND_MACVLAN &&
netdev->kind != NETDEV_KIND_IPIP &&