Skip to content

Commit

Permalink
fabrics: add udev rule to avoid renaming nbft interfaces
Browse files Browse the repository at this point in the history
In the initramfs, the interface naming is taken care of by dracut.
But there are various network-interface-naming policies in place which
may attempt to rename the interface, causing confusion and possibly
wrong interface parameters.

Add an udev rule that avoids renaming any network interface that
has been assigned a name nbft$N, which is by convention the naming
scheme that is used for NBFT device in the initramfs.

Note: The simpler 'NAME:="%k"' directive doesn't work because udev rejects
it ('Ignoring NAME="%k", as it will take no effect.'). The ":=" syntax makes
sure the interface isn't renamed any more by later rules. "INTERFACE" is set
by the kernel in the "add" uevent for a network interface.

Signed-off-by: Martin Wilck <mwilck@suse.com>
  • Loading branch information
mwilck authored and igaw committed Nov 8, 2023
1 parent 5ea373e commit 096c3e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ foreach file : systemd_files
endforeach

udev_files = [
'65-persistent-net-nbft.rules',
'70-nvmf-autoconnect.rules',
'71-nvmf-netapp.rules',
]
Expand Down
2 changes: 2 additions & 0 deletions nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Avoid renaming nbft$X interfaces
SUBSYSTEM=="net", ACTION!="remove", ENV{INTERFACE}=="nbft*", NAME:="%E{INTERFACE}"

0 comments on commit 096c3e6

Please sign in to comment.