diff options
author | Susant Sahani <susant@redhat.com> | 2014-05-12 10:48:24 +0530 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-05-12 17:37:12 +0200 |
commit | 7951dea20911969287878e6897b3eca348721ade (patch) | |
tree | 420a101f2a4e3912b9d078bcf16bf06e8ff94742 /src/network/networkd-link.c | |
parent | 1727a595225132eb73ec134b6979d9c713b42e8c (diff) |
networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip
example conf:
file: ipip.netdev
[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480
[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64
file: ipip.network
[Match]
Name=em1
[Network]
Tunnel=ipip-tun
[tomegun:
- drop unused variable
- take ref when enslaving]
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index d07cc30951..77c505fc78 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1466,7 +1466,9 @@ static int link_enter_enslave(Link *link) { link_save(link); - if (!link->network->bridge && !link->network->bond && + if (!link->network->bridge && + !link->network->bond && + !link->network->tunnel && hashmap_isempty(link->network->vlans) && hashmap_isempty(link->network->macvlans)) return link_enslaved(link); @@ -1515,6 +1517,28 @@ static int link_enter_enslave(Link *link) { link->enslaving ++; } + if (link->network->tunnel) { + log_struct_link(LOG_DEBUG, link, + "MESSAGE=%s: enslaving by '%s'", + link->ifname, link->network->tunnel->name, + NETDEV(link->network->tunnel), + NULL); + + r = netdev_enslave(link->network->tunnel, link, &enslave_handler); + if (r < 0) { + log_struct_link(LOG_WARNING, link, + "MESSAGE=%s: could not enslave by '%s': %s", + link->ifname, link->network->tunnel->name, strerror(-r), + NETDEV(link->network->tunnel), + NULL); + link_enter_failed(link); + return r; + } + + link_ref(link); + link->enslaving ++; + } + HASHMAP_FOREACH(vlan, link->network->vlans, i) { log_struct_link(LOG_DEBUG, link, "MESSAGE=%s: enslaving by '%s'", |