Drop support for macvtap

This has been broken because of other changes on the network scripts and
since we now have support for bridges there is no point in supporting
something else that has the same functionality.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Daniel Weismüller
2021-04-07 14:56:16 +00:00
committed by Michael Tremer
parent 39fbc945eb
commit 73476dd9dc
6 changed files with 5 additions and 25 deletions

View File

@@ -36,7 +36,6 @@ include "/etc/collectd.precache"
<Plugin interface>
Interface "lo"
Interface "/[0-9]*phys$/"
Interface "/^macvtap[0-9]*$/"
Interface "/^vnet[0-9]*$/"
IgnoreSelected true
</Plugin>

View File

@@ -1,3 +1,4 @@
etc/collectd.conf
etc/rc.d/init.d/suricata
etc/sysctl.conf
lib/udev/network-hotplug-bridges

View File

@@ -62,6 +62,10 @@ rm -rfv \
# Reload sysctl.conf
sysctl -p
# Migrate any macvtap interfaces to bridge
sed -e "s/_MODE=macvtap/_MODE=bridge/g" \
-i /var/ipfire/ethernet/settings
# Start services
telinit u
/etc/init.d/suricata restart

View File

@@ -112,15 +112,6 @@ case "${MODE}" in
ip link set dev "${INTERFACE}" up
;;
macvtap)
ADDRESS="$(</sys/class/net/${INTERFACE}/address)"
GENERATED_ADDRESS=$(random_mac_address)
ip link add link "${INTERFACE}" "${BRIDGE}" address "${ADDRESS}" type macvlan mode bridge
ip link set "${INTERFACE}" address "${GENERATED_ADDRESS}"
ip link set "${INTERFACE}" up
;;
"")
exit 0
;;

View File

@@ -78,16 +78,6 @@ for zone in ${ZONES}; do
(( counter += 1 ))
done
;;
macvtap)
# MACVTAP mode doesn't work for WiFi devices
if [ -d "/sys/class/net/${INTERFACE}/phy80211" ]; then
logger -t network "MACVTAP mode is not supported for wireless devices"
echo "${!device}"
else
echo "${!device%0}phys0"
fi
;;
esac
done

View File

@@ -345,8 +345,6 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
if ($zone_mode eq "BRIDGE") {
$ethsettings{"${uc}_MODE"} = "bridge";
$ethsettings{"${uc}_SLAVES"} = $slave_string;
} elsif ($zone_mode eq "MACVTAP") {
$ethsettings{"${uc}_MODE"} = "macvtap";
}
# STP options
@@ -423,8 +421,6 @@ foreach (@zones) {
$mode_selected{"DEFAULT"} = "selected";
} elsif ($zone_mode eq "bridge") {
$mode_selected{"BRIDGE"} = "selected";
} elsif ($zone_mode eq "macvtap") {
$mode_selected{"MACVTAP"} = "selected";
}
print <<END
@@ -432,7 +428,6 @@ foreach (@zones) {
<select name="MODE $uc" data-zone="$uc" onchange="changeZoneMode(this)">
<option value="DEFAULT" $mode_selected{"DEFAULT"}>$Lang::tr{"zoneconf nicmode default"}</option>
<option value="BRIDGE" $mode_selected{"BRIDGE"}>$Lang::tr{"zoneconf nicmode bridge"}</option>
<option value="MACVTAP" $mode_selected{"MACVTAP"}>$Lang::tr{"zoneconf nicmode macvtap"}</option>
</select>
</td>
END