chiark / gitweb /
Add DEPLOYMENT to hostnamectl
[elogind.git] / src / network / networkd-netdev.c
index a810be04b9fe19d9a945dfa0ad002a171576a28c..88b692fbabf5cff75a3e6171bf1323854efe9606 100644 (file)
@@ -48,6 +48,7 @@ static const char* const netdev_kind_table[_NETDEV_KIND_MAX] = {
 DEFINE_STRING_TABLE_LOOKUP(netdev_kind, NetDevKind);
 DEFINE_CONFIG_PARSE_ENUM(config_parse_netdev_kind, netdev_kind, NetDevKind, "Failed to parse netdev kind");
 
+
 static void netdev_cancel_callbacks(NetDev *netdev) {
         _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
         netdev_enslave_callback *callback;
@@ -244,35 +245,6 @@ static int netdev_create_handler(sd_rtnl *rtnl, sd_rtnl_message *m, void *userda
         return 1;
 }
 
-int config_parse_tunnel_address(const char *unit,
-                                const char *filename,
-                                unsigned line,
-                                const char *section,
-                                unsigned section_line,
-                                const char *lvalue,
-                                int ltype,
-                                const char *rvalue,
-                                void *data,
-                                void *userdata) {
-        NetDev *n = userdata;
-        union in_addr_union *addr = data;
-        int r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        r = net_parse_inaddr(rvalue, &n->family, addr);
-        if (r < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
-                           "Tunnel address is invalid, ignoring assignment: %s", rvalue);
-                return 0;
-        }
-
-        return 0;
-}
-
 static int netdev_create(NetDev *netdev) {
         _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
         const char *kind;
@@ -594,13 +566,14 @@ static int netdev_load_one(Manager *manager, const char *filename) {
         netdev->state = _NETDEV_STATE_INVALID;
         netdev->kind = _NETDEV_KIND_INVALID;
         netdev->macvlan_mode = _NETDEV_MACVLAN_MODE_INVALID;
+        netdev->bond_mode = _NETDEV_BOND_MODE_INVALID;
         netdev->vlanid = VLANID_MAX + 1;
         netdev->vxlanid = VXLAN_VID_MAX + 1;
         netdev->tunnel_pmtudisc = true;
         netdev->learning = true;
 
         r = config_parse(NULL, filename, file,
-                         "Match\0NetDev\0VLAN\0MACVLAN\0VXLAN\0Tunnel\0Peer\0Tun\0Tap\0",
+                         "Match\0NetDev\0VLAN\0MACVLAN\0VXLAN\0Tunnel\0Peer\0Tun\0Tap\0Bond\0",
                          config_item_perf_lookup, (void*) network_netdev_gperf_lookup,
                          false, false, netdev);
         if (r < 0) {
@@ -723,19 +696,15 @@ static int netdev_load_one(Manager *manager, const char *filename) {
 
                 break;
         case NETDEV_KIND_BRIDGE:
-        case NETDEV_KIND_BOND:
                 r = netdev_create(netdev);
                 if (r < 0)
                         return r;
                 break;
-
-        case NETDEV_KIND_TUN:
-        case NETDEV_KIND_TAP:
-                r = netdev_create_tuntap(netdev);
+        case NETDEV_KIND_BOND:
+                r = netdev_create_bond(netdev, netdev_create_handler);
                 if (r < 0)
                         return r;
                 break;
-
         default:
                 break;
         }