RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1469718 - ifaddresses() method disregards ipv4 link local addresses.
Summary: ifaddresses() method disregards ipv4 link local addresses.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-netifaces
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Petr Vobornik
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-11 17:42 UTC by Andrei Stepanov
Modified: 2019-06-03 16:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-03 16:38:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andrei Stepanov 2017-07-11 17:42:13 UTC
Documentations says:

    ifaddresses(...)
        Obtain information about the specified network interface.
        Returns a dict whose keys are equal to the address family constants,
        e.g. netifaces.AF_INET, and whose values are a list of addresses in
        that family that are attached to the network interface.

There is a bug with this method. It ignores IP4LL addresses: https://en.wikipedia.org/wiki/Link-local_address#IPv4


rpm -qf /usr/lib64/python2.7/site-packages/netifaces.so
python-netifaces-0.10.4-3.el7.x86_64


How reproducible: always.


Steps to Reproduce:
1. Assign to an interface ip4ll address.

You can assign ip4ll address in 2 ways:

Create connection with NetworkManager that has type "autoip" or you can install RPM package avahi-autoipd, and assign IP4LL address with next command:

avahi-autoipd --force-bind enp0s25
Found user 'avahi-autoipd' (UID 170) and group 'avahi-autoipd' (GID 170).
Successfully called chroot().
Successfully dropped root privileges.
Starting with address 169.254.8.212
Callout BIND, address 169.254.8.212 on interface enp0s25
Successfully claimed IP address 169.254.8.212
(open other terminal)


2. Check with 'ip' command that interface has ip4ll address:


ip addr show dev enp0s25


2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 54:ee:75:37:4a:d6 brd ff:ff:ff:ff:ff:ff
    inet 169.254.8.212/16 brd 169.254.255.255 scope link enp0s25:avahi
       valid_lft forever preferred_lft forever
    inet 10.xx.xx.xx/24 brd 10.43.12.255 scope global dynamic enp0s25
       valid_lft 69642sec preferred_lft 69642sec
    inet6 2620:52:0:2b0c:56ee:75ff:fe37:4ad6/64 scope global noprefixroute dynamic 
       valid_lft 2591541sec preferred_lft 604341sec
    inet6 fe80::56ee:75ff:fe37:4ad6/64 scope link 
       valid_lft forever preferred_lft forever


3. Get all addresses with netifaces.ifaddresses():

python -c 'import netifaces, pprint; pprint.pprint(netifaces.ifaddresses("enp0s25"));'
{2: [{'addr': '10.xx.xx.xx',
      'broadcast': '10.xx.xx.xx',
      'netmask': '255.255.255.0'}],
 10: [{'addr': '2620:52:0:2b0c:56ee:75ff:fe37:4ad6',
       'netmask': 'ffff:ffff:ffff:ffff::'},
      {'addr': 'fe80::56ee:75ff:fe37:4ad6%enp0s25',
       'netmask': 'ffff:ffff:ffff:ffff::'}],
 17: [{'addr': '54:ee:75:37:4a:d6', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]}


Actual results: As you can see list, there is no entry for 169.254.8.212/16 address.

Expected results: 169.254.8.212/16 must be in the dictionary.


Note You need to log in before you can comment on or make changes to this bug.