Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-73404

fix: Prioritize find link info by permanent MAC address, with fallback to current address

    • rhel-system-roles-1.94.1-0.1.el9
    • No
    • Low
    • rhel-sst-system-roles
    • 0
    • QE ack, Dev ack
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Red Hat Enterprise Linux
    • None
    • Bug Fix
    • Hide
      .The `network` RHEL system role prioritizes permanent MAC address matching

      When all of the following conditions were met:

      * A network connection specified both an interface name and a media access control (MAC) address for configuring a parent and a virtual local area network (VLAN) connection.

      * The physical interface had the same permanent and current MAC address.

      * The networking configuration was applied multiple times.

      The `network` RHEL system role compared the user-specified MAC address against either the permanent MAC or the current MAC address from the `sysfs` virtual filesystem. The role then treated a match with the current MAC as valid even if the interface name was different from what the user specified.
      As a consequence, the "no such interface exists" error occurred. With this update, the `link_info_find()` method prioritizes matching links by permanent MAC address when it is valid and available. If the permanent MAC is unavailable (None or "00:00:00:00:00:00"), the method falls back to matching the current MAC address.
      As a result, this change improves the robustness of MAC address matching by ensuring that permanent addresses are prioritized while maintaining a reliable fallback mechanism for interfaces with no permanent address.
      Show
      .The `network` RHEL system role prioritizes permanent MAC address matching When all of the following conditions were met: * A network connection specified both an interface name and a media access control (MAC) address for configuring a parent and a virtual local area network (VLAN) connection. * The physical interface had the same permanent and current MAC address. * The networking configuration was applied multiple times. The `network` RHEL system role compared the user-specified MAC address against either the permanent MAC or the current MAC address from the `sysfs` virtual filesystem. The role then treated a match with the current MAC as valid even if the interface name was different from what the user specified. As a consequence, the "no such interface exists" error occurred. With this update, the `link_info_find()` method prioritizes matching links by permanent MAC address when it is valid and available. If the permanent MAC is unavailable (None or "00:00:00:00:00:00"), the method falls back to matching the current MAC address. As a result, this change improves the robustness of MAC address matching by ensuring that permanent addresses are prioritized while maintaining a reliable fallback mechanism for interfaces with no permanent address.
    • Done
    • None

      Enhancement:
      Updated the link_info_find method to prioritize matching links by perm-address when it is valid and available. If the perm-address is unavailable (None or "00:00:00:00:00:00"), the method falls back to matching by address. Additionally, if ifname is provided, it takes precedence and returns the corresponding linkinfo immediately.

      Reason:
      The change resolves scenarios where multiple network interfaces might
      share the same current MAC address (address), leading to potential
      ambiguity in link matching. By prioritizing the permanent MAC address
      (perm-address), the method provides a more precise and consistent match.
      This is particularly crucial in environments with:

      • MAC address spoofing or dynamic changes, where the current MAC
        address may not reliably identify the interface.
      • Virtual interfaces or VLANs, which often lack a valid perm-address
        and rely on the parent interface's address.
      • Ambiguity when multiple interfaces share the same address.

      Result:
      This change improves the robustness of MAC address matching by ensuring
      that permanent addresses are prioritized while maintaining a reliable
      fallback mechanism for interfaces with no permanent address.

      Issue Tracker Tickets (Jira or BZ if any):

              rmeggins@redhat.com Richard Megginson
              rmeggins@redhat.com Richard Megginson
              Richard Megginson Richard Megginson
              David Jez David Jez
              Jaroslav Klech Jaroslav Klech
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: