summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-06-16 11:54:33 +0530
committerTom Gundersen <teg@jklm.no>2014-06-16 20:38:22 +0200
commit326cb4061a7d6ec4107f298b6f947d645512ad76 (patch)
tree3508a9288e03c4cc7a5d882b9de7748781b16b9b /src/network/networkd-link.c
parent1324e3ae515719a93a94a8d8316644af6c780909 (diff)
networkd: introduce vxlan
This patch enables netwokd to create vxlan Changes: Added: 1. File networkd networkd-vxlan.c 2. to netdev bool learning struct in_addr group uint64_t vxlanid; 3. VXLAN subsection and config parameters
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f496978cba..7c738fe81c 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1492,7 +1492,7 @@ static int enslave_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userdata) {
}
static int link_enter_enslave(Link *link) {
- NetDev *vlan, *macvlan;
+ NetDev *vlan, *macvlan, *vxlan;
Iterator i;
int r;
@@ -1508,7 +1508,8 @@ static int link_enter_enslave(Link *link) {
!link->network->bond &&
!link->network->tunnel &&
hashmap_isempty(link->network->vlans) &&
- hashmap_isempty(link->network->macvlans))
+ hashmap_isempty(link->network->macvlans) &&
+ hashmap_isempty(link->network->vxlans))
return link_enslaved(link);
if (link->network->bond) {
@@ -1625,6 +1626,27 @@ static int link_enter_enslave(Link *link) {
link->enslaving ++;
}
+ HASHMAP_FOREACH(vxlan, link->network->vxlans, i) {
+ log_struct_link(LOG_DEBUG, link,
+ "MESSAGE=%*s: enslaving by '%s'",
+ IFNAMSIZ,
+ link->ifname, vxlan->ifname, NETDEV(vxlan), NULL);
+
+ r = netdev_enslave(vxlan, link, &enslave_handler);
+ if (r < 0) {
+ log_struct_link(LOG_WARNING, link,
+ "MESSAGE=%*s: could not enslave by '%s': %s",
+ IFNAMSIZ,
+ link->ifname, vxlan->ifname, strerror(-r),
+ NETDEV(vxlan), NULL);
+ link_enter_failed(link);
+ return r;
+ }
+
+ link_ref(link);
+ link->enslaving ++;
+ }
+
return 0;
}