From 11106c499057d3c2e2f4e4eaf04eb00f05f067ca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 3 Nov 2019 12:27:10 +0100 Subject: [PATCH] vxlan: the idea was to have pluggable device code :) While here change the expected device name from "vxlan.X" to "vxlanX", since "." denotes the newer FreeBSD VLAN ID syntax on top of parent devices (e.g. "igb0.12") and all devices should follow the regex of "^[a-z]+[0-9]+". --- src/etc/inc/plugins.inc.d/core.inc | 1 - src/etc/inc/plugins.inc.d/vxlan.inc | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/core.inc b/src/etc/inc/plugins.inc.d/core.inc index 4b0a3103a..6f3e1b124 100644 --- a/src/etc/inc/plugins.inc.d/core.inc +++ b/src/etc/inc/plugins.inc.d/core.inc @@ -129,7 +129,6 @@ function core_devices() $devices[] = array('pattern' => '_stf', 'volatile' => true); $devices[] = array('pattern' => '_wlan', 'volatile' => true); $devices[] = array('pattern' => 'vlan', 'volatile' => true); - $devices[] = array('pattern' => 'vxlan', 'volatile' => true); return $devices; } diff --git a/src/etc/inc/plugins.inc.d/vxlan.inc b/src/etc/inc/plugins.inc.d/vxlan.inc index 39642fc29..cc5f35a8e 100644 --- a/src/etc/inc/plugins.inc.d/vxlan.inc +++ b/src/etc/inc/plugins.inc.d/vxlan.inc @@ -34,6 +34,14 @@ ); } +function vxlan_devices() +{ + $devices = array(); + + $devices[] = array('pattern' => '^vxlan', 'volatile' => true, 'configurable' => false); + + return $devices; +} function vxlan_configure_interface($verbose=false) { @@ -64,7 +72,7 @@ function vxlan_configure_interface($verbose=false) // skip when interface address is not assigned (yet) continue; } - $device_name = "vxlan.{$vxlan->deviceId}" ; + $device_name = "vxlan{$vxlan->deviceId}"; $configured_devices[] = $device_name; $current_settings = array( "vxlanid" => null,