Unverified Commit 62406585 authored by intrigeri's avatar intrigeri
Browse files

Have MAC address spoofing ignore veth* devices via udev

This has 2 advantages:

 - Not running tails-spoof-mac when it's not relevant
   addresses the problem at the root and avoids logging
   potentially confusing stuff (at least when udev logging
   is set to debug).
 - The logic we had in tails-spoof-mac to ignore veth*
   never worked for veth0. This fixes it.
parent c8aec2fa
......@@ -4,6 +4,8 @@
# Disable MAC spoofing for the following devices
# iPhone tethering ethernet over USB
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", DRIVERS=="ipheth", GOTO="mac_spoof_ignore"
# veth interfaces used by network namespaces
ENV{INTERFACE}=="veth*", ACTION=="add", GOTO="mac_spoof_ignore"
# Perform MAC spoofing otherwise
SUBSYSTEM=="net", ACTION=="add", ATTR{type}=="1", RUN+="/usr/local/lib/tails-spoof-mac $name"
......
......@@ -28,11 +28,6 @@ get_all_veth_nics() {
cut -d '@' -f 1
}
is_veth_nic() {
# checks if argument is a veth nic
get_all_veth_nics | grep -F --line-regexp -q "${1}"
}
nic_exists() {
[ -e /sys/class/net/"${1}" ]
}
......
......@@ -107,12 +107,6 @@ set_log_tag spoof-mac
NIC="${1}"
if is_veth_nic "${NIC}"
then
log -t debug "NIC ${NIC} is actually a veth; no spoofing"
exit 0
fi
if ! mac_spoof_is_enabled; then
exit 0
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment