mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 09:04:55 +00:00
udev-rules: only invoke ethtool for existing interfaces
ethtool may cause the auto-loading of a kernel module for non-existing interface-names. Avoid that by checking whether such an interface exists. This is inherently racy.
This commit is contained in:
parent
ab41c13b06
commit
44fee0f6ff
|
@ -6,7 +6,7 @@ SUBSYSTEM!="net", GOTO="nm_unmanaged_end"
|
|||
# Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?)
|
||||
ENV{ID_NET_DRIVER}=="?*", GOTO="nm_unmanaged_driver"
|
||||
DRIVERS=="?*", GOTO="nm_unmanaged_driver"
|
||||
PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $env{INTERFACE} |/bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
|
||||
PROGRAM="/bin/sh -c 'test -e "/sys/class/net/$env{INTERFACE}" && /usr/sbin/ethtool -i "$env{INTERFACE}" | /bin/sed -n s/^driver:\ //p'", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
|
||||
LABEL="nm_unmanaged_driver"
|
||||
|
||||
# VirtualBox host networking. Out-of-tree driver that looks like an ordinary
|
||||
|
|
Loading…
Reference in a new issue