- if (netdev->kind != NETDEV_KIND_VXLAN && netdev->vxlanid <= VXLAN_VID_MAX) {
- log_warning("VXLAN Id configured for a %s in %s. Ignoring",
- netdev_kind_to_string(netdev->kind), filename);
+ netdev_raw = new0(NetDev, 1);
+ if (!netdev_raw)
+ return log_oom();
+
+ netdev_raw->kind = _NETDEV_KIND_INVALID;
+
+ r = config_parse(NULL, filename, file,
+ "Match\0NetDev\0",
+ config_item_perf_lookup, network_netdev_gperf_lookup,
+ true, false, true, netdev_raw);
+ if (r < 0)
+ return r;
+
+ r = fseek(file, 0, SEEK_SET);
+ if (r < 0)
+ return -errno;
+
+ /* skip out early if configuration does not match the environment */
+ if (net_match_config(NULL, NULL, NULL, NULL, NULL,
+ netdev_raw->match_host, netdev_raw->match_virt,
+ netdev_raw->match_kernel, netdev_raw->match_arch,
+ NULL, NULL, NULL, NULL, NULL, NULL) <= 0)
+ return 0;
+
+ if (!NETDEV_VTABLE(netdev_raw)) {
+ log_warning("NetDev with invalid Kind configured in %s. Ignoring", filename);