[systemd-devel] [PATCH 1/2] networkd: ipip tunell add address support
Susant Sahani
susant at redhat.com
Sun Apr 13 21:06:44 PDT 2014
This patch extends supports to configure address
for ipip tunnel patch.
File: ipip.network
[Match]
Name=em1
[Network]
Tunnel=ipip-tun
Address=192.168.10.24
---
src/network/networkd-address.c | 8 +++++++-
src/network/networkd-link.c | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 87688a5..5d8bec5 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -231,6 +231,7 @@ int address_update(Address *address, Link *link,
int address_configure(Address *address, Link *link,
sd_rtnl_message_handler_t callback) {
_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+ int if_index;
int r;
assert(address);
@@ -240,8 +241,13 @@ int address_configure(Address *address, Link *link,
assert(link->manager);
assert(link->manager->rtnl);
+ if(link->network->tunnel)
+ if_index = if_nametoindex(link->network->tunnel->name);
+ else
+ if_index = link->ifindex;
+
r = sd_rtnl_message_new_addr(link->manager->rtnl, &req, RTM_NEWADDR,
- link->ifindex, address->family);
+ if_index, address->family);
if (r < 0) {
log_error("Could not allocate RTM_NEWADDR message: %s",
strerror(-r));
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 92434a6..7c9616a 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1305,6 +1305,7 @@ static int link_enter_enslave(Link *link) {
}
link->enslaving ++;
+ return link_enslaved(link);
}
HASHMAP_FOREACH(vlan, link->network->vlans, i) {
--
1.9.0
More information about the systemd-devel
mailing list